Skip to content

Commit

Permalink
Correct the show_prefix behavior so it has proper whitespacing
Browse files Browse the repository at this point in the history
  • Loading branch information
raven42 committed Nov 4, 2024
1 parent 3f1d238 commit ac87a71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions autoload/tagbar/prototypes/basetag.vim
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ endfunction
function! s:_getPrefix() abort dict
let fileinfo = self.fileinfo

if !empty(self._childlist)
if !empty(self._childlist) && g:tagbar_show_prefix == 1
if fileinfo.tagfolds[self.fields.kind][self.fullpath]
let prefix = g:tagbar#icon_closed
else
Expand All @@ -95,9 +95,9 @@ function! s:_getPrefix() abort dict
endif
" Visibility is called 'access' in the ctags output
if g:tagbar_show_visibility
if has_key(self.fields, 'access')
if has_key(self.fields, 'access') && g:tagbar_show_prefix == 1
let prefix .= get(s:visibility_symbols, self.fields.access, ' ')
elseif has_key(self.fields, 'file')
elseif has_key(self.fields, 'file') && g:tagbar_show_prefix == 1
let prefix .= s:visibility_symbols.private
else
let prefix .= ' '
Expand Down
6 changes: 1 addition & 5 deletions autoload/tagbar/prototypes/normaltag.vim
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ function! s:strfmt() abort dict
let suffix = ''
endif

if g:tagbar_show_prefix == 1
let prefix = self._getPrefix()
else
let prefix = ''
endif
let prefix = self._getPrefix()

if g:tagbar_show_tag_linenumbers == 1
let suffix .= ' [' . self.fields.line . ']'
Expand Down

0 comments on commit ac87a71

Please sign in to comment.