weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

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

Closed yaocccc closed 2 years ago

yaocccc commented 2 years ago

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

weirongxu commented 2 years ago

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

yaocccc commented 2 years ago

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

weirongxu commented 2 years ago

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

yaocccc commented 2 years ago

when enter vim,

:hi CocExplorerNormalFloat E411: hl group not found

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

yaocccc commented 2 years ago

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

yaocccc commented 2 years ago

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

weirongxu commented 2 years ago

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

yaocccc commented 2 years ago

https://github.com/weirongxu/coc-explorer/issues/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

weirongxu commented 2 years ago

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

weirongxu commented 2 years ago

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

line  226:
E419: FG color unknown
yaocccc commented 2 years ago

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

yaocccc commented 2 years ago

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