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:
Ingo Karkat 2013-04-12 21:22:27 +02:00
parent 32b5b15b52
commit 2665695f57

View File

@ -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 . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='