mirror of
https://github.com/preservim/tagbar.git
synced 2024-11-26 02:13:44 +08: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:
parent
32b5b15b52
commit
2665695f57
|
@ -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 . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
|
||||
|
|
Loading…
Reference in New Issue
Block a user