mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-15 14:12:46 +08:00
FIX: Avoid that the sigils used for highlighting match inside a tag.
When there's a tag e.g. "foo-bar", the "-bar" part is matched as TagbarKind. Add a zero-width condition to all sigil patterns that allow only whitespace characters before the sigil.
This commit is contained in:
parent
87d293206b
commit
32b5b15b52
|
@ -12,20 +12,20 @@ if exists("b:current_syntax")
|
|||
endif
|
||||
|
||||
let s:ics= escape(join(g:tagbar_iconchars, ''), ']^\-')
|
||||
let s:pattern = '\([' . s:ics . '] \?\)\@<=[^-+: ]\+[^:]\+$'
|
||||
let s:pattern = '\(\S\@<![' . s:ics . '] \?\)\@<=[^-+: ]\+[^:]\+$'
|
||||
execute "syntax match TagbarKind '" . s:pattern . "'"
|
||||
|
||||
let s:pattern = '\([' . s:ics . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
|
||||
let s:pattern = '\(\S\@<!' . s:ics . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
|
||||
execute "syntax match TagbarScope '" . s:pattern . "'"
|
||||
|
||||
let s:pattern = '[' . s:ics . ']\([-+# ]\?\)\@='
|
||||
let s:pattern = '\S\@<![' . s:ics . ']\([-+# ]\?\)\@='
|
||||
execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
|
||||
|
||||
let s:pattern = '\([' . s:ics . ' ]\)\@<=+\([^-+# ]\)\@='
|
||||
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=+\([^-+# ]\)\@='
|
||||
execute "syntax match TagbarVisibilityPublic '" . s:pattern . "'"
|
||||
let s:pattern = '\([' . s:ics . ' ]\)\@<=#\([^-+# ]\)\@='
|
||||
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=#\([^-+# ]\)\@='
|
||||
execute "syntax match TagbarVisibilityProtected '" . s:pattern . "'"
|
||||
let s:pattern = '\([' . s:ics . ' ]\)\@<=-\([^-+# ]\)\@='
|
||||
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=-\([^-+# ]\)\@='
|
||||
execute "syntax match TagbarVisibilityPrivate '" . s:pattern . "'"
|
||||
|
||||
unlet s:pattern
|
||||
|
|
Loading…
Reference in New Issue
Block a user