From 2e2ba2eab252b05051d4ca7cd87b2fcb23a411d6 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sat, 2 Nov 2013 21:51:15 +1300 Subject: [PATCH] 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. --- autoload/tagbar.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 7b4d786..d7744ff 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -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')