I recently setup my work machine and for some reason, when working with
putty and tmux I cannot see the visual highlight if the background
option is set to dark (which is what I use). I noticed that :hi Visual shows
Visual xxx term=reverse ctermbg=242 guibg=DarkGrey
background=dark
term=tmux-256color
Adding the attribute cterm=reverse helps, so let's make that the
default so that :hi Visual shows:
Visual xxx term=reverse cterm=reverse ctermbg=242 guibg=DarkGrey
https://github.com/vim/vim/pull/8247
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Merging #8247 (38342ec) into master (f5409db) will decrease coverage by
86.99%.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #8247 +/- ## =========================================== - Coverage 89.46% 2.46% -87.00% =========================================== Files 148 146 -2 Lines 166969 161828 -5141 =========================================== - Hits 149373 3990 -145383 - Misses 17596 157838 +140242
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | ? |
|
| huge-gcc-none | ? |
|
| huge-gcc-testgui | ? |
|
| huge-gcc-unittests | 2.46% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/highlight.c | 8.00% <ø> (-82.46%) |
⬇️ |
| src/sha256.c | 0.00% <0.00%> (-97.96%) |
⬇️ |
| src/digraph.c | 0.00% <0.00%> (-97.78%) |
⬇️ |
| src/gui_gtk_f.c | 0.00% <0.00%> (-97.54%) |
⬇️ |
| src/match.c | 0.00% <0.00%> (-97.13%) |
⬇️ |
| src/crypt_zip.c | 0.00% <0.00%> (-97.06%) |
⬇️ |
| src/evalbuffer.c | 0.00% <0.00%> (-96.83%) |
⬇️ |
| src/debugger.c | 0.00% <0.00%> (-96.62%) |
⬇️ |
| src/libvterm/src/rect.h | 0.00% <0.00%> (-96.56%) |
⬇️ |
| src/textprop.c | 0.00% <0.00%> (-96.45%) |
⬇️ |
| ... and 135 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update f5409db...38342ec. Read the comment docs.
Color 242 should map to rgb 6c6c6c that is normally well-distinguishable from black. So it rather looks as misconfiguration of some sort. And setting "reverse"...
// Reverse looks ugly, but grey may not work for 8 colors. Thus let it // depend on the number of colors available. // With 8 colors brown is equal to yellow, need to use black for Search fg // to avoid Statement highlighted text disappears. // Clear the attributes, needed when changing the t_Co value. if (t_colors > 8) do_highlight((char_u *)(*p_bg == 'l' ? "Visual cterm=NONE ctermbg=LightGrey" : "Visual cterm=NONE ctermbg=DarkGrey"), FALSE, TRUE); else { do_highlight((char_u *)"Visual cterm=reverse ctermbg=NONE", FALSE, TRUE); ...
There's a different trick: :hi Visual cterm=NONE ctermfg=bg ctermbg=fg. Then it does not depend on extra color(s) and the whole selected area will uniformly look as "reverse normal" that is guaranteed to have enough contrast. However, in this case we also temporarily lose foreground coloring, so I don't think that everyone will be happy. Personally I prefer this one (in my own color scheme), but the major part of other color schemes seem to adopt "extra special selection background" as in Vim default.
Color 242 should map to rgb 6c6c6c that is normally well-distinguishable from black. So it rather looks as misconfiguration of some sort. And setting "reverse"...
Yes, but if the color would not be visible, setting reverse should not have an effect.
"Reverse" swaps foreground and background colors, so it will have some effects anyway (these cyan and magenta background spots in picture no. 2). You probably mean that reverse text got color 242 while still seeming distinguishable from the black background. I admit I don't know why is this. Maybe it's not. Maybe it only seems distinguishable while being on cyan background...
I cannot reproduce the problem. Perhaps Vim thinks the terminal supports 256 colors, but it actually only supports 8 or 16 colors?
Using "reverse" looks quite bad when the terminal is correctly setup.
What is the value of t_Co for you? What happens if you set t_Co to 16?
Closed #8247.