Attempting to fix rulers/cursor highlighting #5568
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue: In #2060 a rulers options was added. This allows for both setting a traditional colorcolumn (background color) or highlighting the foreground at the column instead (text color). The two themes I’m using as example are the default Helix theme (colors foreground at ruler) and catppuccin_mocha (colors background at ruler). In the current state both versions work well, with the caveat/bug that the cursor at the colorcolumn has no visible background when setting the background color of the ruler. Following screenshots compare the current state and this draft:
The default theme has a working ruler in the original, the fix breaks the ruler (characters at the column are no longer themed).
Catppuccin_mocha has a visible ruler in the original, but the cursor background is the background of the ruler and the character is unreadable. The fix themes the cursor again.
All I want to do is point out that the current implementation has problems for a majority of the themes, because most themes set the background color of the virtual ruler, not the foreground color. The only thing I did was switching it up and rendering rulers first. Apparently the text highlights are then able to overrule the ruler theming—which in turn breaks themes which set the foreground color of the ruler (a minority). I wonder whether there is a way to get both working properly.