RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.14k stars 47 forks source link

vim-illuminate does not work in NVIM v0.5.0-dev+1231-g48e805728 #70

Closed dstadelm closed 3 years ago

dstadelm commented 3 years ago

After investigation I know this is not an issue of vim-illuminate. But I don't know how I should report this in nvim as I can't formulate what actually is broken in nvim 0.5.0 a colorscheme is also required.

It seems that highlight groups aren't applied when sourcing in init.vim the first time. I checked out the competition like vim_current_word and though they work with the default settings, when overriding the highlight groups they are only applied if I resource the files for the highlight settings.

Minimal config:

call minpac#init() call minpac#add('k-takata/minpac', {'type': 'opt'}) packadd minpac command! PackUpdate call minpac#update() command! PackClean call minpac#clean() "install/source onedark call minpac#add('joshdick/onedark.vim', {'type': 'opt'}) packadd onedark.vim set termguicolors colorscheme onedark set colorcolumn=120 set background=dark "install/source illuminate call minpac#add('RRethy/vim-illuminate', {'type': 'opt'}) packadd vim-illuminate hi link illuminatedWord Visual

RRethy commented 3 years ago

Try (:h illuminatedWord):

autocmd VimEnter * hi link illuminatedWord Visual
dstadelm commented 3 years ago

Oh dear, I think I searched help but my eyes skipped this. Thank you for the hint.

However I think this is not the issue I was hunting down. The highlight line in my minimal config is probably misleading and can be discarded. The default highlighting does not work in nvim 0.5.0 but it actually does in nvim 0.4.4.

Maybe it will be fixed in nvim anyhow sometime, I don't know if there is a necessity to take any action, I only wanted to point it out.

For now I will use autocmd VimEnter * hi link illuminatedWord CursorLine

RRethy commented 3 years ago

Your version of Neovim won't matter so it's config related. I'm going to close this but if you want to figure it out, try with nvim --clean and manually load the plugin.

dstadelm commented 3 years ago

Well I think I disagree

Using the config shown in the images and starting nvim with -u

With nvim 0.4.4 the result looks like this (call highlighted) image with nvim 0.5.0 the result looks like this (call not highlighted) image

RRethy commented 3 years ago

What is the output of :echo exists('g:loaded_illuminate') when using nvim 0.5.0? I use nvim 0.5.0 and it works fine. This plugin doesn't use fancy features, it uses parts of the api that have been available and stable for years.

dstadelm commented 3 years ago

The output is 1

RRethy commented 3 years ago

What about:

echo g:Illuminate_ftHighlightGroups
echo g:Illuminate_ftblacklist
echo g:Illuminate_ftwhitelist
echo g:Illuminate_delay
echo g:Illuminate_highlightUnderCursor
echo g:Illuminate_highlightPriority
echo g:Illuminate_insert_mode_highlight
echo b:illuminate_enabled

And can you screenshot the output from:

hi illuminatedWord
hi illuminatedCurWord
dstadelm commented 3 years ago

image

image

image image

RRethy commented 3 years ago

illuminatedWord is being cleared somewhere in your nvim config.