Closed leoatchina closed 1 year ago
Thanks for the very detailed issue report! 🙌 Let me look into this.
What does :verbose hi Conceal
return?
Conceal xxx ctermfg=239 ctermbg=202 guifg=#5a524c guibg=#ff5f00
最近修改于 ~/.leovim.d/plug/coc.nvim/indentLine/after/plugin/indentLine.vim line 88
There you go, Conceal
was overwritten by indentLine.vim (#5a524c
#ff5f00
)
Are you using a theme in your terminal which might be overriding grey colors, such as base16-shell?
Actually , after I deleted line 1493 in gruvbox-mateial.vim, this bug disappeared
I donot installed base16-shell
, but have tested lots of colorschemes, and I am sure this bug is only related with edge
, sonokai
, gruvbox-material
, everest
indentline is forcing the background color to your terminal's color, so if you rewrote these to orange (like base16-shell does), they will show as orange in Vim too:
What happens if you reload the colorscheme, for example with :colorscheme desert | colorscheme gruvbox-material
?
sublime
desert
edge
everforest
sonokai
gruvbox-material after I delete line 1493
The reason why you don't see it in other colorschemes is because gruvbox-material (and all sainnhe's themes) doesn't force a background color, so indentline happily enforces its own color on top. This is a bad default from the plugin in my opinion.
Try this:
" Apply custom highlights on colorscheme change.
" Must be declared before executing ':colorscheme'.
augroup custom_highlights_gruvboxmaterial
autocmd!
" reset indentline default
autocmd ColorScheme gruvbox-material
\ hi! Conceal ctermbg=NONE guibg=NONE
augroup END
colorscheme gruvbox-material
or in Lua
-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
grpid = vim.api.nvim_create_augroup('custom_highlights_gruvboxmaterial', {})
vim.api.nvim_create_autocmd('ColorScheme', {
group = grpid,
pattern = 'gruvbox-material',
command = -- reset indentline default
'hi! Conceal ctermbg=NONE guibg=NONE'
})
vim.cmd'colorscheme gruvbox-material'
Should be like this
augroup Fix_CocExploererIndentline
autocmd!
autocmd ColorScheme gruvbox-material hi! CocExplorerIndentLine ctermbg=NONE guibg=NONE
autocmd ColorScheme edge hi! CocExplorerIndentLine ctermbg=NONE guibg=NONE
autocmd ColorScheme sonokai hi! CocExplorerIndentLine ctermbg=NONE guibg=NONE
autocmd ColorScheme everforest hi! CocExplorerIndentLine ctermbg=NONE guibg=NONE
augroup END
Also fixed vimLineComment bug
augroup Fix_CocColorScheme
autocmd!
autocmd ColorScheme edge,sonokai,everforest,gruvbox-material autocmd BufWinEnter * hi! vimLineComment ctermbg=NONE guibg=NONE
autocmd ColorScheme edge,sonokai,everforest,gruvbox-material hi! CocExplorerIndentLine ctermbg=NONE guibg=NONE
augroup END
It would be better to fix the Conceal
highlight group directly like I suggested.
The root cause of your issues is that indenline hijacks the Conceal
group (which is a Vim core highlight group and shouldn't be overridden by plugins).
If you fix Conceal
, you fix all issues at once.
Actually I have tried to fix Conceal
group at first bu not work, so I tried CocExplorerIndentLine and it worked
I have done the following steps before reporting this issue:
Operating system/version
windows but ssh to linux
Terminal emulator/version
All terminal I have used , include tabby , windows terminal, wezterm , mobaxterm
$TERM environment variable
not need
Tmux version
not need
Feature matrix
Open Coc-explore in vim/neovim, either sidebar or float
Minimal vimrc that can reproduce this bug.
not need , It happend when use colorscheme
sonokai
,edge
,gruvbox-material
,everest
After I changed colorscheme to
nightfox
Steps to reproduce this bug using minimal vimrc
coc.nvim
, andcoc-explore
, and opendcoc-explorer
:inspect
on the orange blockverbose highlight CocExploreIndent
4 got thisExpected behavior
not orange indentline
Actual behavior
orange indentline