1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

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
This commit is contained in:
Jan Larres
2017-12-17 16:14:51 +13:00
parent c004652797
commit 387bbadda9

View File

@@ -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