From 387bbadda98e1376ff3871aa461b1f0abd4ece70 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sun, 17 Dec 2017 16:14:51 +1300 Subject: [PATCH] Highlight correctly if visibility disabled The highlight pattern for the current tag didn't account for the fact that the visibility symbol is optional. Closes #463 --- autoload/tagbar.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index fd51e5b..4d5a1f1 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -1941,7 +1941,7 @@ function! s:HighlightTag(openfolds, ...) abort call winline() let foldpat = '[' . g:tagbar#icon_open . g:tagbar#icon_closed . ' ]' - let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\zs[^( ]\+\ze/' + let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\?\zs[^( ]\+\ze/' call tagbar#debug#log("Highlight pattern: '" . pattern . "'") if hlexists('TagbarHighlight') " Safeguard in case syntax highlighting is disabled execute 'match TagbarHighlight ' . pattern