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

Change ui_window_style_set and change the way cursorline is drawn #1229

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

infastin
Copy link

Changes:

  • ui_window_style_set now accepts keep flag, that allows to not override non-default style values (fg and bg);
  • ui_window_style_set_pos and win_style also accept the same flag;
  • win:style and win:style_pos both accept the same keep flag, but it is optional;
  • Now when drawing cursorline the CURSOR_LINE style won't override non-default values of other styles on the line.

This was mainly done so that CURSOR_LINE wouldn't override other styles, but plugins can potentially benefit from this as well.

@rnpnr
Copy link
Collaborator

rnpnr commented Jan 20, 2025

Hi! I'm not sure I understand the point? CURSOR_LINE already doesn't override non-default styles if the user didn't request it. For example the zenburn theme only specifies the background for CURSOR_LINE so whatever foreground was set by the other rules remains unchanged when CURSOR_LINE is applied.

@infastin
Copy link
Author

infastin commented Jan 20, 2025

Hi! I'm not sure I understand the point? CURSOR_LINE already doesn't override non-default styles if the user didn't request it. For example the zenburn theme only specifies the background for CURSOR_LINE so whatever foreground was set by the other rules remains unchanged when CURSOR_LINE is applied.

If other styles on the same line have non-default background, then CURSOR_LINE will override them. That's is kind of the problem when using vis-sneak plugin, which sets CURSOR style on matches, which is then "overriden" by CURSOR_LINE when you are on the same line with the match.

Before:

image

After:

image

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.

2 participants