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

fix(statusline): set hl_group for statusline separators #616

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielwe
Copy link

@danielwe danielwe commented Jan 17, 2025

Description

Currently, statusline segments have custom highlight groups, but the separators between the segments don't get any highlight group applied, resulting gaps/discontinuities in the statusline background with most colorschemes. This PR applies the highlight group provided to trouble.statusline, if any, to the separators as well as to any segments that don't supply their own highlight group.

The fix involves a slight refactor of the fix_statusline functionality such that segment hl backgrounds are substituted in advance rather than via post hoc search and replace.

I also added a clause to filter out empty segments which would otherwise result in extraneous separators, usually appended to the end of the statusline string. Let me know if these empty segments/extra separators were intentional and I'll revert that change.

Related Issue(s)

The author closed the issue when a workaround was posted, but I figured it would be worthwhile to fix this properly in the plugin.

Screenshots

Before: Note the gap between open and view:wait as well as the double gap after view:wait
Screen Shot 2025-01-16 at 16 55 55 PM

After: The single remaining gap after view:wait is due to a bug in lualine.nvim; I'm submitting a PR there too
Screen Shot 2025-01-16 at 16 53 11 PM

EDIT: With nvim-lualine/lualine.nvim#1368: No gaps!
Screen Shot 2025-01-16 at 17 18 20 PM

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.

bug: Incorrect Lualine Highlight
1 participant