coc.nvim icon indicating copy to clipboard operation
coc.nvim copied to clipboard

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

Open Archdsenna opened this issue 1 year ago • 2 comments

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?

Archdsenna avatar Aug 13 '24 07:08 Archdsenna

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

fannheyward avatar Aug 16 '24 03:08 fannheyward

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?

Archdsenna avatar Aug 17 '24 02:08 Archdsenna

  "diagnostic.floatConfig": {
    "highlight": "MyFloat"
  },

fannheyward avatar Oct 31 '24 08:10 fannheyward