Skip to content

Commit

Permalink
chore(plugin): check if highlight is cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Dec 12, 2022
1 parent 641698b commit 12cf67c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ function! s:Highlight() abort
for [key, value] in items(hlMap)
let ts = get(value, 0, '')
let fallback = get(value, 1, '')
execute 'hi default link CocSem'.key.' '.(hlexists(ts) ? ts : fallback)
execute 'hi default link CocSem'.key.' '.(coc#highlight#valid(ts) ? ts : fallback)
endfor
endif
let symbolMap = {
Expand Down Expand Up @@ -627,7 +627,7 @@ function! s:Highlight() abort
\ 'TypeParameter': ['@parameter', 'Identifier'],
\ }
for [key, value] in items(symbolMap)
let hlGroup = hlexists(value[0]) ? value[0] : get(value, 1, 'CocSymbolDefault')
let hlGroup = coc#highlight#valid(value[0]) ? value[0] : get(value, 1, 'CocSymbolDefault')
if hlexists(hlGroup)
execute 'hi default CocSymbol'.key.' '.coc#highlight#get_hl_command(synIDtrans(hlID(hlGroup)), 'fg', '223', '#ebdbb2')
endif
Expand Down

0 comments on commit 12cf67c

Please sign in to comment.