Skip to content

Commit

Permalink
Correct the behavior of the custom ctagsbin override
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
raven42 committed Jun 5, 2024
1 parent 5d6990e commit 6613953
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions autoload/tagbar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -771,19 +771,18 @@ endfunction

" s:CheckFTCtags() {{{2
function! s:CheckFTCtags(bin, ftype) abort
if executable(a:bin)
return a:bin
endif

if exists('g:tagbar_type_' . a:ftype)
let userdef = g:tagbar_type_{a:ftype}
if has_key(userdef, 'ctagsbin')
return userdef.ctagsbin
else
if has_key(userdef, 'kinds')
return ''
elseif has_key(userdef, 'ctagsbin')
return userdef.ctagsbin
endif
endif

if executable(a:bin)
return a:bin
endif
return ''
endfunction

Expand Down

0 comments on commit 6613953

Please sign in to comment.