Th3Whit3Wolf / one-nvim

Atom one theme
MIT License
113 stars 23 forks source link

IncSearch highlight is hard to see #7

Closed rnevius closed 3 years ago

rnevius commented 3 years ago

The IncSearch highlight should probably have a background to distinguish matches better. This background could ideally be a completely different color (or even just a slightly different hue) than the Search highlight.

The issue can be seen when matching Numbers, Booleans, and more:

image

As you can see, the matched line is highlighted differently, but the matched text is not during incsearch (because the IncSearch highlight matches these other highlight groups). When <CR> is pressed, the match is highlighted more clearly by the Search highlight:

image

This gets even more confusing when there are other incsearch matches in the buffer, because everything except for the first match is highlighted clearly during the search.

Th3Whit3Wolf commented 3 years ago

This colorscheme is pretty much a lua port of rakr/vim-one which is were this behavior comes from. joshdick/onedark.vim sets the IncSearch background to the same as the comments. How does IncSearch look when you set the background color to #a0a1a7?

rnevius commented 3 years ago

This colorscheme is pretty much a lua port of rakr/vim-one which is were this behavior comes from

I moved to Th3Whit3Wolf/one-nvim from rakr/vim-one, and the latter definitely doesn't have this issue. Here's what happens when I do the same search as in the original issue, while using vim-one:

image

As expected, the search result is clearly incrementally highlighted.

More specifically, the highlight groups for Search and IncSearch are as follows when using the light background variant:

Th3Whit3Wolf/one-nvim rakr/vim-one
Search ctermbg=11 guifg=#fafafa guibg=#c18401 ctermfg=255 ctermbg=136 guifg=#fafafa guibg=#c18401
IncSearch cterm=reverse guifg=#986801 cterm=reverse ctermfg=94 gui=reverse guifg=#986801

The same issue also appears in the dark background version.

Th3Whit3Wolf commented 3 years ago

Neither should be setting reverse style for cterm or gui. It looks like your cterm colors aren't being set correctly either based on your table.

Th3Whit3Wolf commented 3 years ago

When you get an opportunity update one-nvim and let me know what you think about the changes to IncSearch background

rnevius commented 3 years ago

Thanks @Th3Whit3Wolf much better!

Regarding your comment about my cterm colors, I'm using kitty as my terminal emulator. Is it possible that these colors are being overridden by kitty? I'm not sure it really matters in my case, but I'd be interested in knowing what could cause something like that.

Th3Whit3Wolf commented 3 years ago

To my knowledge the terminal should not be able to affect variables inside of neovim other than environment variables. I would guess that another plugin is modifying IncSearch and Search but I'm not sure.

Th3Whit3Wolf commented 3 years ago

Also have you set termguicolors?

rnevius commented 3 years ago

Yes, 'termguicolors' is set.

Th3Whit3Wolf commented 3 years ago

It looks like something set reverse style for cterm and gui on rakr/vim-one and only cterm on one-nvim. Since termguicolors is set the cterm value is ignored.