diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index e88760f..8d12ce3 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -81,10 +81,20 @@ if !exists('g:tagbar_foldlevel') let g:tagbar_foldlevel = 99 endif -if has('multi_byte') && &encoding == 'utf-8' && - \ (empty(&termencoding) || &termencoding == 'utf-8') - let s:icon_closed = '▶' - let s:icon_open = '▼' +if !exists('g:tagbar_usearrows') + let g:tagbar_usearrows = 0 +endif + + +if has('multi_byte') + if has('unix') && &encoding == 'utf-8' && + \ (empty(&termencoding) || &termencoding == 'utf-8') + let s:icon_closed = '▶' + let s:icon_open = '▼' + elseif (has('win32') || has('win64')) && g:tagbar_usearrows + let s:icon_closed = '▷' + let s:icon_open = '◢' + endif else let s:icon_closed = '+' let s:icon_open = '-' diff --git a/syntax/tagbar.vim b/syntax/tagbar.vim index f7fab7d..a85d561 100644 --- a/syntax/tagbar.vim +++ b/syntax/tagbar.vim @@ -9,16 +9,27 @@ if exists("b:current_syntax") finish endif -if has('multi_byte') && &encoding == 'utf-8' && - \ (empty(&termencoding) || &termencoding == 'utf-8') - syntax match TagbarKind '\([▶▼][-+ ]\)\@<=[^-+: ]\+[^:]\+$' - syntax match TagbarScope '[^-+#▶▼(* ]\+\(\*\? :\)\@=' +if has('multi_byte') + if has('unix') && &encoding == 'utf-8' && + \ (empty(&termencoding) || &termencoding == 'utf-8') + syntax match TagbarKind '\([▶▼][-+ ]\)\@<=[^-+: ]\+[^:]\+$' + syntax match TagbarScope '[^-+#▶▼(* ]\+\(\*\? :\)\@=' - syntax match TagbarFoldIcon '[▶▼]\([-+# ]\)\@=' + syntax match TagbarFoldIcon '[▶▼]\([-+# ]\)\@=' - syntax match TagbarAccessPublic '\([▶▼ ]\)\@<=+\([^-+# ]\)\@=' - syntax match TagbarAccessProtected '\([▶▼ ]\)\@<=#\([^-+# ]\)\@=' - syntax match TagbarAccessPrivate '\([▶▼ ]\)\@<=-\([^-+# ]\)\@=' + syntax match TagbarAccessPublic '\([▶▼ ]\)\@<=+\([^-+# ]\)\@=' + syntax match TagbarAccessProtected '\([▶▼ ]\)\@<=#\([^-+# ]\)\@=' + syntax match TagbarAccessPrivate '\([▶▼ ]\)\@<=-\([^-+# ]\)\@=' + elseif (has('win32') || has('win64')) && g:tagbar_usearrows + syntax match TagbarKind '\([▷◢][-+ ]\)\@<=[^-+: ]\+[^:]\+$' + syntax match TagbarScope '[^-+#▷◢(* ]\+\(\*\? :\)\@=' + + syntax match TagbarFoldIcon '[▷◢]\([-+# ]\)\@=' + + syntax match TagbarAccessPublic '\([▷◢ ]\)\@<=+\([^-+# ]\)\@=' + syntax match TagbarAccessProtected '\([▷◢ ]\)\@<=#\([^-+# ]\)\@=' + syntax match TagbarAccessPrivate '\([▷◢ ]\)\@<=-\([^-+# ]\)\@=' + endif else syntax match TagbarKind '\([-+][-+ ]\)\@<=[^-+: ]\+[^:]\+$' syntax match TagbarScope '[^-+#(* ]\+\(\*\? :\)\@='