summaryrefslogtreecommitdiffstats
path: root/src/highlight.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-01-28 23:33:29 +0100
committerChristian Brabandt <cb@256bit.org>2024-01-28 23:38:28 +0100
commite6d8b4662ddf9356da53f56e363b67b524fd8825 (patch)
treed93055a5466e8987dfbd7f9f5281740f5220702c /src/highlight.c
parentbdb9d9afba9769b1cb9c0b320086142d99034c9a (diff)
patch 9.1.0061: UX of visual highlighting can be improvedv9.1.0061
Problem: UX of visual highlighting can be improved Solution: Improve readibility of visual highlighting, by setting better foreground and background colors The default visual highlighting currently is nice in that it overlays the actual syntax highlighting by using a separate distinct background color. However, this can cause hard to read text, because the contrast between the actual syntax element and the background color is way too low. That is an issue, that has been bothering colorschemes authors for quite some time so much, that they are defining the Visual highlighting group to use a separate foreground and background color, so that the syntax highlighting vanishes, but the text remains readable (ref: vim/colorschemes#250) So this is an attempt to perform the same fix for the default Visual highlighting and just use a default foreground and background color instead of using reverse. I also removed the hard-coded changes to the Visual highlighting in init_highlight. It's not quite clear to me, why those were there and not added directly to the highlighting_init_<dark|light> struct. closes: #13663 related: vim/colorschemes#250 Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/highlight.c')
-rw-r--r--src/highlight.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/highlight.c b/src/highlight.c
index 3381208fd1..85726f828d 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -221,8 +221,8 @@ static char *(highlight_init_light[]) = {
CENT("SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue",
"SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue"),
#endif
- CENT("Visual term=reverse",
- "Visual term=reverse guibg=LightGrey"),
+ CENT("Visual ctermbg=DarkGrey ctermfg=White",
+ "Visual ctermbg=DarkGrey ctermfg=White guibg=LightGrey"),
#ifdef FEAT_DIFF
CENT("DiffAdd term=bold ctermbg=LightBlue",
"DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue"),
@@ -310,8 +310,8 @@ static char *(highlight_init_dark[]) = {
CENT("SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan",
"SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan"),
#endif
- CENT("Visual term=reverse",
- "Visual term=reverse guibg=DarkGrey"),
+ CENT("Visual ctermbg=Grey ctermfg=Black",
+ "Visual ctermbg=Grey ctermfg=Black guibg=#575757"),
#ifdef FEAT_DIFF
CENT("DiffAdd term=bold ctermbg=DarkBlue",
"DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue"),
@@ -438,14 +438,8 @@ init_highlight(
// 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
+ if (t_colors <= 8)
{
- do_highlight((char_u *)"Visual cterm=reverse ctermbg=NONE",
- FALSE, TRUE);
if (*p_bg == 'l')
do_highlight((char_u *)"Search ctermfg=black", FALSE, TRUE);
}