Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to format tabs with highlights #1098

Closed
wants to merge 1 commit into from

Conversation

Slotos
Copy link

@Slotos Slotos commented Sep 19, 2023

This adds a handling of optional fmt return value that is a table of {highlight = "*", name = "*"} or {name = "*"} tables. The primary goal is to have highlights not count to the visible character limit. Without it, attempts to format the tab name with highlights cause nearly immediate ellipsification.

Due to crossbleed in the test setup, a buffers component test was also updated to test through buffer commands. Frankly, when using bufferline, one should forget about tab commands, as the real state of vim windows is hidden and unpredictable.

As an example of a practical outcome, with this it's possible to add colored devicons to a tabs tabline:
image

I am trying to keep this as dumb as possible, since windows and their users are inherently more complex than buffers, leading to various ways to usefully represent them that individual users would know best about.

@Slotos Slotos force-pushed the tabs-highlight-formatting branch from 777abbd to 297368b Compare September 19, 2023 18:02
@Slotos Slotos force-pushed the tabs-highlight-formatting branch from 297368b to 19b7294 Compare October 17, 2023 12:54
@Slotos
Copy link
Author

Slotos commented Oct 17, 2023

Rebased the changes on top of master.

This adds a handling of optional `fmt` return value that is a table of
`{highlight = "*", name = "*"}` or `{name = "*"}` tables. The primary
goal is to have highlights not count to the visible character limit.
Without it, attempts to format the tab name with highlights cause nearly
immediate ellipsification.

Due to crossbleed in the test setup, a buffers component test was also
updated to test through _buffer_ commands. Frankly, when using
bufferline, one should forget about tab commands, as the real state of
vim windows is hidden and unpredictable.

Mode handling had been forced to not interact with table processing at
all. If user provides a detailed table, they are assumed to be in
control.
@Slotos Slotos force-pushed the tabs-highlight-formatting branch from 19b7294 to d349268 Compare October 19, 2023 14:20
@Slotos Slotos closed this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant