-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Search and/or IncSearch highlighting disappears if the highlighted word happens to be on a ColorColumn.
How to recreate
- Start a new buffer and run the following commands:
:colorscheme github
:set hlsearch incsearch
:set colorcolumn=3,4,5
:normal ggiThisIsMyTest- Search for
hisIs(broken IncSearch highlight) then hit Enter (broken Search highlight)
My solution
Normally the way colorschemes get around this issue is by setting gui=reverse cterm=reverse on both IncSearch and Search highlight groups. However, doing so here results in a pale text on a pale background when the highlighted characters are on the ColorColumn. This makes the text ineligible. It also resets the foreground colour of the text inside the highlight, which isn't ideal...
Personally, I decided to fix this issue by taking a clue from GitHub and disabling ColorColumn highlighting all together: hi clear ColorColumn. After all, GitHub doesn't support ColorColumn so by not coloring them in the theme stays true to GitHub's visual styling.
However, this solution might not be to everyone's taste.