[vim/vim] `listchar` not using its highlight groups in selection (Issue #19872)

10 views
Skip to first unread message

Doug

unread,
Mar 31, 2026, 2:46:22 AMMar 31
to vim/vim, Subscribed
dougaak created an issue (vim/vim#19872)

I mainly want to ask if this is the expected behavior, but even if it is, personally I find it strange.

I use the leadmultispace to achieve the indentation ruler, and I noticed that in my own color scheme, those characters will not have the correct color in selection. It will use the highlight group of the first non-blank character in that line.

image.png (view on web)

Version: 9.2.89
OS: Windows, using terminal Vim in Windows Terminal, not gVim


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19872@github.com>

Christian Brabandt

unread,
Apr 22, 2026, 12:43:46 PMApr 22
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19872)

how do you reproduce this?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19872/4298118438@github.com>

Doug

unread,
Apr 22, 2026, 11:10:06 PMApr 22
to vim/vim, Subscribed
dougaak left a comment (vim/vim#19872)

Hi @chrisbra , I think this should work, assuming in terminal Vim.

  1. Start without profile: vim --clean
  2. Input something with leading whitespaces, e.g. "    hello world"
  3. :set list
  4. :set lcs+=space:+
  5. :hi clear Visual
  6. :hi Visual ctermbg=DarkBlue
  7. :hi SpecialKey ctermfg=Red
  8. After the above steps, the whitespaces should be in a red color "+"
  9. Now visual-select the whole line, and the whitespaces shall be in white, as it's using the Normal group


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19872/4301482180@github.com>

Christian Brabandt

unread,
Jun 13, 2026, 4:06:30 PM (11 hours ago) Jun 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19872)

That is what I got with a plain stock Vim (v9.2.0640) using your steps.
image.png (view on web)

That is the expected value, no?


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19872/4699642330@github.com>

Doug

unread,
Jun 13, 2026, 11:04:41 PM (4 hours ago) Jun 13
to vim/vim, Subscribed
dougaak left a comment (vim/vim#19872)

Hi @chrisbra , I'm not sure what do you mean by "expected value".

If you mean this is the expected "end result" of the reproduction step, then yes, as you can see the "plus" symbols are all in white.

But I think this is not a "correct result", as in the previous step the lcs has been set to make the "plus" symbols in red (as they are the whitespace letters), but visual selecting them will somehow make them white, which indicates that they are using the Normal highlight group for fg color (not the Visual group, as in the previous step the Visual group has been set to only have bg color).

For me it feels strange that visual selection will affect the coloring of the letters controlled by lcd settings. If you may reference the first pic I post, you can see that it's not even using the Normal group, it's using whichever the effective group of the first visible letter (i.e. the whitespace index line letter becomes orange in my pic as the first visible letter is in orange).

So if you mean by "expected correct value of Vim's behavior" then personally, no, I don't think it should look like that. Those "plus" symbol should stay red instead of white, using the set "SpecialKey" group.

I'm not familiar with the Vim source code yet so I'm incapable to directly contribute, but it seems that the stalled PR aiming to fix this issue was already on the right track. I would be grateful if you can take a second look on it.

Thanks a lot.


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19872/4700528249@github.com>

Reply all
Reply to author
Forward
0 new messages