mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-18 12:00:23 +01:00
Improve tag highlighting and signature matching (#735)
1. Correctly highlight tags that contain spaces. 2. Match function signature on special case: operator()(...).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user