weirongxu/coc-explorer

[BUG] 'hi CocExplorerNormalFloat ctermbg=none guibg=none' not worked

yaocccc opened this issue · 12 comments

Describe the bug

I set hi CocExplorerNormalFloat ctermbg=none guibg=none in my vimrc, but it worked.

Result from CocInfo

versions

vim version: NVIM v0.8.0-dev+468-ge694e56422
node version: v16.8.0
coc.nvim version: 0.0.81-2522eee5 2022-06-14 19:03:29 +0800
coc.nvim directory: /home/chenyc/.config/nvim/plugged/coc.nvim
term: st-256color
platform: linux

Steps to reproduce
Steps to reproduce the behavior:

  1. execute nvim
  2. :CocExplorer ...
  3. See error

Expected behavior

image

Additional context
None

Should be set the highlight after the autocmd CoorScheme

autocmd ColorScheme *
      \ hi CocExplorerNormalFloatBorder guifg=#dddddd guibg=#373B34
      \ | hi CocExplorerNormalFloat guibg=none

https://github.com/weirongxu/coc-explorer/wiki/Highlight#custom-highlight-example

Should be set the highlight after the autocmd CoorScheme

autocmd ColorScheme *
      \ hi CocExplorerNormalFloatBorder guifg=#dddddd guibg=#373B34
      \ | hi CocExplorerNormalFloat guibg=none

https://github.com/weirongxu/coc-explorer/wiki/Highlight#custom-highlight-example

autocmd ColorScheme * hi CocExplorerNormalFloat guibg=none ctermbg=none

It still not worked

AND I try hi CocExplorerNormalFloat ctermfg=fg, It worked

What is the result of your :hi CocExplorerNormalFloat when it doesn't work?

when enter vim,

:hi CocExplorerNormalFloat
E411: hl group not found

when I enter coc-explorer after
:hi CocExplorerNormalFloat
CocExplorerNormalFloat xxx links to NormalFloat

If i set hi CocExplorerNormalFloat ctermbg=none guibg=none in my vimrc

when enter vim,

:hi CocExplorerNormalFloat
CocExplorerNormalFloat xxx cleared

when I enter coc-explorer after
:hi CocExplorerNormalFloat
CocExplorerNormalFloat xxx links to NormalFloat

If i set hi hi CocExplorerNormalFloat ctermfg=fg in my vimrc

when enter vim,

:hi CocExplorerNormalFloat
CocExplorerNormalFloat xxx ctermfg=7

when I enter coc-explorer after
:hi CocExplorerNormalFloat
CocExplorerNormalFloat xxx ctermfg=7

May I know what vim theme you are using? I'm wondering if the theme has did something because I can't reproduce it

#449

之前有提过一次issues的,就是现象是在vimrc里设置了
hi CocExplorerNormalFloat ctermbg=none guibg=none

当进入vim后
:hi CocExplorerNormalFloat
CocExplorerNormalFloat xxx cleared

然后启动一次coc-explorer后,似乎 coc-explorer会认为 用户未设置过 CocExplorerNormalFloat 然后用了 CocExplorerNormalFloat xxx links to NormalFloat

我的颜色主题 https://github.com/yaocccc/nvim/blob/master/colors/solarized8_high.vim

因为主题里会调用 hi clear,你在 vimrc 里写的 hi CocExplorerNormalFloat ctermfg=none 可能会被清除掉,
所以必须要在主题切换完后再调用 hi,所以要加上 autocmd ColorScheme *

我用 fg 会发生错误 hi CocExplorerNormalFloat ctermfg=fg

line  226:
E419: FG color unknown

比较诡异,我在 我把hi clear去掉了,
autocmd ColorScheme * hi CocExplorerNormalFloat ctermbg=1 guibg=1
等等都不生效

fg为Normal对应的fg。算了老板不纠结啦,hi CocExplorerNormalFloat ctermfg=fg 用这个是ok的。

似乎表现就是,当我进入vim后, CocExplorerNormalFloat是设置过的且不是双none(cleared) 就可以解决问题
突然变成这样了,之前用的挺好的 感谢感谢,不纠结了

当进入vim后
:hi CocExplorerNormalFloat
CocExplorerNormalFloat xxx cleared

然后启动一次coc-explorer后,似乎 coc-explorer会认为 用户未设置过 CocExplorerNormalFloat 然后用了 CocExplorerNormalFloat xxx links to NormalFloat