Skip to content

Commit 0815b54

Browse files
authored
Correct the behavior of the custom ctagsbin override (#881)
In the event the user has defined a custom ctagsbin for a specific type, and they have also defined the `kinds`, then we do not want to override that choice. Instead only override the `kinds` if the custom ctagsbin is set without the `kinds` being provided.
1 parent 12edcb5 commit 0815b54

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

autoload/tagbar.vim

+6-7
Original file line numberDiff line numberDiff line change
@@ -771,19 +771,18 @@ endfunction
771771

772772
" s:CheckFTCtags() {{{2
773773
function! s:CheckFTCtags(bin, ftype) abort
774-
if executable(a:bin)
775-
return a:bin
776-
endif
777-
778774
if exists('g:tagbar_type_' . a:ftype)
779775
let userdef = g:tagbar_type_{a:ftype}
780-
if has_key(userdef, 'ctagsbin')
781-
return userdef.ctagsbin
782-
else
776+
if has_key(userdef, 'kinds')
783777
return ''
778+
elseif has_key(userdef, 'ctagsbin')
779+
return userdef.ctagsbin
784780
endif
785781
endif
786782

783+
if executable(a:bin)
784+
return a:bin
785+
endif
787786
return ''
788787
endfunction
789788

0 commit comments

Comments
 (0)