diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 52295b7..fdc9895 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -2273,10 +2273,11 @@ function! s:HighlightTag(openfolds, ...) abort " If printing the line number of the tag to the left, and the tag is " visible (I.E. parent isn't folded) + let identifier = '\zs\V' . tag.name . '\m\ze' if g:tagbar_show_tag_linenumbers == 2 && tagline == tag.tline - let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\[[0-9]\+\] \?\zs[^( ]\+\ze/' + let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\[[0-9]\+\] \?' . identifier . '/' else - let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\?\zs[^( ]\+\ze/' + let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\?' . identifier . '/' endif call tagbar#debug#log("Highlight pattern: '" . pattern . "'") if hlexists('TagbarHighlight') " Safeguard in case syntax highlighting is disabled diff --git a/syntax/tagbar.vim b/syntax/tagbar.vim index e869656..3f4d515 100644 --- a/syntax/tagbar.vim +++ b/syntax/tagbar.vim @@ -38,7 +38,7 @@ syntax match TagbarHelpTitle '" \zs-\+ \w\+ -\+' contained syntax match TagbarNestedKind '^\s\+\[[^]]\+\]$' syntax match TagbarType ' : \zs.*' contains=TagbarTagLineN syntax match TagbarTagLineN '\s\+\[[0-9]\+\]\(\s\+\|$\)' -syntax match TagbarSignature '(.*)' +syntax match TagbarSignature '\(\