Blend SpecialKey and Visual by habamax · Pull Request #20845 · vim/vim · GitHub
Skip to content

Blend SpecialKey and Visual - #20845

Draft
habamax wants to merge 1 commit into
vim:masterfrom
habamax:listchars
Draft

habamax wants to merge 1 commit into
vim:masterfrom
habamax:listchars

Conversation

@habamax

@habamax habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

with default colorscheme and

  • vim --clean
  • hi Visual ctermbg=237 ctermfg=NONE:
  • hi SpecialKey ctermfg=red
  • set list listchars=tab:>-

before:
image

after:
image

@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

hm, unfortunately it is not applied to the space, lead, multispace, eol parts of listchars

image

@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

hm, unfortunately it is not applied to the space, lead, multispace, eol parts of listchars

Should be fixed for everything apart of eol, $ in the screenshot:
image

Current end of line is in quite a few other tests, failing if extra_attr is applied to eol. Tests could be fixed, but before doing it, @chrisbra, need your approve :)

e.g.:

command line..script /home/habamax/prj/habamax-vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_highlight_eol_with_cursorline_vertsplit[69]..Check_lcs_eol_attrs line 4: Expected [2114, 2114, 2114, 2114, 2057, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0] but got [2114, 2114, 2114, 2114, 2115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
make: *** [Makefile:78: test_highlight] Error 1

PS, 2 failing tests seems unrelated to the changes I've made.

@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

wrt endofline, this is how I would expect it to be:

image

@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@zeertzjq could suggest where to look to fix following:

image

or

image

As you can see if after the listchars there is a string, it inherits the highlight instead of using SpecialKey.

Comment thread src/drawline.c Outdated
@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@zeertzjq I think existing dumps should work with the change(I have reverted all dump changes), but they are not, most probably due to unexpected blend of SpecialKey into Visual when it has both foreground and background set, e.g. evening colorscheme:

image

And it should look like this (because Visual has foreground):

image

@habamax

habamax commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@habamax
habamax marked this pull request as draft July 26, 2026 23:28
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.

listchar not using its highlight groups in selection

2 participants