Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 66468eb

Browse files
authoredDec 16, 2020
fix: make highlighting work for new vim
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)
1 parent 4904077 commit 66468eb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
 

‎autoload/youcompleteme.vim

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -370,26 +370,26 @@ function! s:SetUpSigns()
370370

371371
if !hlexists( 'YcmErrorSign' )
372372
if hlexists( 'SyntasticErrorSign')
373-
highlight link YcmErrorSign SyntasticErrorSign
373+
highlight default link YcmErrorSign SyntasticErrorSign
374374
else
375-
highlight link YcmErrorSign error
375+
highlight default link YcmErrorSign error
376376
endif
377377
endif
378378

379379
if !hlexists( 'YcmWarningSign' )
380380
if hlexists( 'SyntasticWarningSign')
381-
highlight link YcmWarningSign SyntasticWarningSign
381+
highlight default link YcmWarningSign SyntasticWarningSign
382382
else
383-
highlight link YcmWarningSign todo
383+
highlight default link YcmWarningSign todo
384384
endif
385385
endif
386386

387387
if !hlexists( 'YcmErrorLine' )
388-
highlight link YcmErrorLine SyntasticErrorLine
388+
highlight default link YcmErrorLine SyntasticErrorLine
389389
endif
390390

391391
if !hlexists( 'YcmWarningLine' )
392-
highlight link YcmWarningLine SyntasticWarningLine
392+
highlight default link YcmWarningLine SyntasticWarningLine
393393
endif
394394

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

407407
if !hlexists( 'YcmErrorSection' )
408408
if hlexists( 'SyntasticError' )
409-
highlight link YcmErrorSection SyntasticError
409+
highlight default link YcmErrorSection SyntasticError
410410
else
411-
highlight link YcmErrorSection SpellBad
411+
highlight default link YcmErrorSection SpellBad
412412
endif
413413
endif
414414

415415
if !hlexists( 'YcmWarningSection' )
416416
if hlexists( 'SyntasticWarning' )
417-
highlight link YcmWarningSection SyntasticWarning
417+
highlight default link YcmWarningSection SyntasticWarning
418418
else
419-
highlight link YcmWarningSection SpellCap
419+
highlight default link YcmWarningSection SpellCap
420420
endif
421421
endif
422422
endfunction

0 commit comments

Comments
 (0)
Please sign in to comment.