From ac87a71bb34694c306b905f76bbd9f222e314003 Mon Sep 17 00:00:00 2001 From: raven42 Date: Mon, 4 Nov 2024 08:14:11 -0600 Subject: [PATCH] Correct the `show_prefix` behavior so it has proper whitespacing --- autoload/tagbar/prototypes/basetag.vim | 6 +++--- autoload/tagbar/prototypes/normaltag.vim | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/autoload/tagbar/prototypes/basetag.vim b/autoload/tagbar/prototypes/basetag.vim index 009054fb..2412b038 100644 --- a/autoload/tagbar/prototypes/basetag.vim +++ b/autoload/tagbar/prototypes/basetag.vim @@ -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 @@ -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 .= ' ' diff --git a/autoload/tagbar/prototypes/normaltag.vim b/autoload/tagbar/prototypes/normaltag.vim index d6e2a196..ec106b95 100644 --- a/autoload/tagbar/prototypes/normaltag.vim +++ b/autoload/tagbar/prototypes/normaltag.vim @@ -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 . ']'