1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-18 03:50:26 +01:00

Make visibility symbols optional

This commit is contained in:
Jan Larres
2012-11-22 18:42:14 +13:00
parent 0ab07ac566
commit 7d836e0c53
4 changed files with 36 additions and 11 deletions

View File

@@ -1208,10 +1208,12 @@ function! s:BaseTag._getPrefix() abort dict
let prefix = ' '
endif
" Visibility is called 'access' in the ctags output
if has_key(self.fields, 'access')
let prefix .= get(s:visibility_symbols, self.fields.access, ' ')
else
let prefix .= ' '
if g:tagbar_show_visibility
if has_key(self.fields, 'access')
let prefix .= get(s:visibility_symbols, self.fields.access, ' ')
else
let prefix .= ' '
endif
endif
return prefix
@@ -2514,7 +2516,10 @@ function! s:PrintKinds(typeinfo, fileinfo) abort
" only if they are not scope-defining tags (since
" those already have an identifier)
if !has_key(a:typeinfo.kind2scope, ckind.short)
silent put =repeat(' ', g:tagbar_indent + 2) .
let indent = g:tagbar_indent
let indent += g:tagbar_show_visibility
let indent += 1 " fold symbol
silent put =repeat(' ', indent) .
\ '[' . ckind.long . ']'
" Add basic tag to allow folding when on the
" header line
@@ -2547,10 +2552,11 @@ function! s:PrintKinds(typeinfo, fileinfo) abort
let foldmarker = s:icon_open
endif
let padding = g:tagbar_show_visibility ? ' ' : ''
if g:tagbar_compact && first_tag && s:short_help
silent 0put =foldmarker . ' ' . kind.long
silent 0put =foldmarker . padding . kind.long
else
silent put =foldmarker . ' ' . kind.long
silent put =foldmarker . padding . kind.long
endif
let curline = line('.')
@@ -2601,7 +2607,10 @@ function! s:PrintTag(tag, depth, fileinfo, typeinfo) abort
" are not scope-defining tags (since those already have an
" identifier)
if !has_key(a:typeinfo.kind2scope, ckind.short)
silent put =repeat(' ', (a:depth + 1) * g:tagbar_indent + 2)
let indent = g:tagbar_indent
let indent += g:tagbar_show_visibility
let indent += 1 " fold symbol
silent put =repeat(' ', (a:depth + 1) * indent)
\ . '[' . ckind.long . ']'
" Add basic tag to allow folding when on the header line
let headertag = s:BaseTag.New(ckind.long)