From 66139530de8e2a34be1299f57e85b57eb06ed586 Mon Sep 17 00:00:00 2001 From: raven42 Date: Wed, 5 Jun 2024 07:57:32 -0500 Subject: [PATCH] Correct the behavior of the custom ctagsbin override 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. --- autoload/tagbar.vim | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index de8b4b3e..a85c1225 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -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