mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-17 19:40:27 +01:00
FIX: Avoid matching public / private methods as TagbarKind.
When g:tagbar_iconchars = ['+', '-'] (default on Windows), and viewing a filetype (e.g. java) that has visibility information (i.e. the [-+#] sigils), the method is mistakenly highlighted as TagbarKind. Restrict its matches to when the sigil is at the beginning of the line to avoid the false matches at the indented method tags.
This commit is contained in:
@@ -12,7 +12,7 @@ if exists("b:current_syntax")
|
||||
endif
|
||||
|
||||
let s:ics= escape(join(g:tagbar_iconchars, ''), ']^\-')
|
||||
let s:pattern = '\(\S\@<![' . s:ics . '] \?\)\@<=[^-+: ]\+[^:]\+$'
|
||||
let s:pattern = '\(^[' . s:ics . '] \?\)\@<=[^-+: ]\+[^:]\+$'
|
||||
execute "syntax match TagbarKind '" . s:pattern . "'"
|
||||
|
||||
let s:pattern = '\(\S\@<!' . s:ics . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
|
||||
|
||||
Reference in New Issue
Block a user