Skip to content

Commit

Permalink
vim-patch:9.1.0061: UX of visual highlighting can be improved (neovim…
Browse files Browse the repository at this point in the history
…#27256)

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/colorschemesvim/vim#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: vim/vim#13663
related: vim/colorschemes#250

vim/vim@e6d8b46

Co-authored-by: Christian Brabandt <[email protected]>
  • Loading branch information
2 people authored and konosubakonoakua committed Feb 4, 2024
1 parent 9637045 commit de08aba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/colors/vim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ if vim.o.background == 'light' then
hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'LightMagenta' })
hi('TabLine', { bg = 'LightGrey', underline = true, ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } })
hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'DarkMagenta' })
hi('Visual', { bg = 'LightGrey', ctermbg = 'LightGrey' })
hi('Visual', { bg = 'LightGrey', ctermfg = 'White', ctermbg = 'DarkGrey' })
hi('WarningMsg', { fg = 'Red', ctermfg = 'DarkRed' })
hi('Comment', { fg = 'Blue', ctermfg = 'DarkBlue' })
hi('Constant', { fg = 'Magenta', ctermfg = 'DarkRed' })
Expand Down Expand Up @@ -270,7 +270,7 @@ else
hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'Magenta' })
hi('TabLine', { bg = 'DarkGrey', underline = true, ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } })
hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'LightMagenta' })
hi('Visual', { bg = 'DarkGrey', ctermbg = 'DarkGrey' })
hi('Visual', { bg = '#575757', ctermfg = 'Black', ctermbg = 'Grey' })
hi('WarningMsg', { fg = 'Red', ctermfg = 'LightRed' })
hi('Comment', { fg = '#80a0ff', ctermfg = 'Cyan' })
hi('Constant', { fg = '#ffa0a0', ctermfg = 'Magenta' })
Expand Down

0 comments on commit de08aba

Please sign in to comment.