Skip to content

Commit

Permalink
fix: make highlighting work for new vim
Browse files Browse the repository at this point in the history
Use `default` for `:highlight`. 
Having it users would be able redefine highlight groups, also colorscheme change would not clear them.

Relates to vim/vim#6970 (comment)
  • Loading branch information
habamax authored Dec 16, 2020
1 parent 4904077 commit 66468eb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions autoload/youcompleteme.vim
Original file line number Diff line number Diff line change
Expand Up @@ -370,26 +370,26 @@ function! s:SetUpSigns()

if !hlexists( 'YcmErrorSign' )
if hlexists( 'SyntasticErrorSign')
highlight link YcmErrorSign SyntasticErrorSign
highlight default link YcmErrorSign SyntasticErrorSign
else
highlight link YcmErrorSign error
highlight default link YcmErrorSign error
endif
endif

if !hlexists( 'YcmWarningSign' )
if hlexists( 'SyntasticWarningSign')
highlight link YcmWarningSign SyntasticWarningSign
highlight default link YcmWarningSign SyntasticWarningSign
else
highlight link YcmWarningSign todo
highlight default link YcmWarningSign todo
endif
endif

if !hlexists( 'YcmErrorLine' )
highlight link YcmErrorLine SyntasticErrorLine
highlight default link YcmErrorLine SyntasticErrorLine
endif

if !hlexists( 'YcmWarningLine' )
highlight link YcmWarningLine SyntasticWarningLine
highlight default link YcmWarningLine SyntasticWarningLine
endif

exe 'sign define YcmError text=' . g:ycm_error_symbol .
Expand All @@ -406,17 +406,17 @@ function! s:SetUpSyntaxHighlighting()

if !hlexists( 'YcmErrorSection' )
if hlexists( 'SyntasticError' )
highlight link YcmErrorSection SyntasticError
highlight default link YcmErrorSection SyntasticError
else
highlight link YcmErrorSection SpellBad
highlight default link YcmErrorSection SpellBad
endif
endif

if !hlexists( 'YcmWarningSection' )
if hlexists( 'SyntasticWarning' )
highlight link YcmWarningSection SyntasticWarning
highlight default link YcmWarningSection SyntasticWarning
else
highlight link YcmWarningSection SpellCap
highlight default link YcmWarningSection SpellCap
endif
endif
endfunction
Expand Down

0 comments on commit 66468eb

Please sign in to comment.