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.
This commit is contained in:
David Hegland 2024-06-06 07:30:43 -05:00 committed by GitHub
parent 12edcb5944
commit 0815b5455c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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