base16-vim icon indicating copy to clipboard operation
base16-vim copied to clipboard

[Bug report] Error highlights are unreadable under cursorline

Open arcnmx opened this issue 2 years ago • 5 comments

The issue described in #23 still exists since the PR seems to have been reverted. The foreground colour of error highlights makes the text nearly indistinguishable from the cursor line highlight bg colour.

before

arcnmx avatar Sep 04 '21 16:09 arcnmx

Does setting :set termguicolors help?

GordianDziwis avatar Sep 05 '21 10:09 GordianDziwis

That doesn't have any effect as far as I can tell.

arcnmx avatar Sep 07 '21 12:09 arcnmx

Can you give a minimal vimrc to reproduce?

GordianDziwis avatar Sep 08 '21 10:09 GordianDziwis

Oh, was this resolved? I'm currently using a fork to resolve it.

Can you give a minimal vimrc to reproduce?

Sorry I missed this, if this is why this was closed I believe it's literally just set cursorline - what's unknown here? The PR to fix it was reverted due to unspecified breakage, but the original issue appears to be pretty self-evident:

  1. non-gui error highlights are set up as fg=base00(default background) bg=base08(deleted/red)
  2. set cursorline applies bg=base01(lighter background) to the current line

So by design, you get text with a foreground of base00 (black) and a background of base01 (slightly less black) - which isn't really a valid combination of base16 colours. I'm not sure whether vim has a concept of highlighter "priorities", but the issue appears to be that CursorLine takes precedence over ErrorHighlight. I found some relevant discussion though, if it helps. Presumably a few options for a solution are to use reverse again as the original PR attempted to do, or to use a foreground colour for ErrorHighlight that wouldn't be invalid and unreadable when mixed with other contexts.

arcnmx avatar Jan 05 '22 20:01 arcnmx

The breakage comes from, that the template is currently set up in a way that thereverse option also applies for gui colors. If you want to to upstream there are two options:

  1. Change the template in a way, that it is possible to set cterm=reverse without setting gui=reverse
  2. Solve the conflict only by setting ctermfg and ctermbg variables.

GordianDziwis avatar Jan 06 '22 10:01 GordianDziwis