mirror of
https://github.com/preservim/tagbar.git
synced 2024-11-26 18:33:36 +08:00
Use standard highlight group if syntax is disabled
This prevents an error message about a non-existent highlighting group when trying to match the tag pattern.
This commit is contained in:
parent
fd79a17189
commit
2e2ba2eab2
|
@ -2891,7 +2891,12 @@ function! s:HighlightTag(openfolds, ...) abort
|
|||
let foldpat = '[' . s:icon_open . s:icon_closed . ' ]'
|
||||
let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\zs[^( ]\+\ze/'
|
||||
call s:LogDebugMessage("Highlight pattern: '" . pattern . "'")
|
||||
execute 'match TagbarHighlight ' . pattern
|
||||
if exists('g:syntax_on') " Safeguard in case syntax highlighting is disabled
|
||||
execute 'match TagbarHighlight ' . pattern
|
||||
else
|
||||
execute 'match Search ' . pattern
|
||||
endif
|
||||
|
||||
|
||||
if a:0 <= 1 " no line explicitly given, so assume we were in the file window
|
||||
call s:winexec(prevwinnr . 'wincmd w')
|
||||
|
|
Loading…
Reference in New Issue
Block a user