neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.32k stars 955 forks source link

Can I set a separate background color for the coc error floating window? #5109

Open Archdsenna opened 1 month ago

Archdsenna commented 1 month ago

I want to change the background color of the coc error floating window (CocErrorFloat). I added the following configuration in init.vim:

highlight! link CocErrorFloat NONE hi CocErrorFloat ctermfg=1 ctermbg=228 Normally, this will change the background color of the CocErrorFloat to light yellow.

But it did not take effect: image

If I modify the background color of CocFloating, I can change the background color of the coc floating warning, but this will also change the background color of other floating windows (such as the completion list). I only want to modify the floating background color of CocErrorFloat alone.

Is it impossible to change the background color of CocErrorFloat?

fannheyward commented 4 weeks ago

You can set with dialog.floatHighlight, by default it's CocFloating, check :h coc-config-dialog-floatHighlight.

Archdsenna commented 3 weeks ago

h coc-config-dialog-floatHighlight

Thanks for your help. I have set dialog.floatHighlight as a custom highlight group, as shown below: Custom highlight group, in init.vim hi myhelight ctermfg=1 ctermbg=228

In coc-settings.json: "dialog.floatHighlight": "myhelight"

But it seems that it still hasn't taken effect. image

Is there something I configured wrong?