From 0815b5455c792a610d28ff3e7981642c9cf05d62 Mon Sep 17 00:00:00 2001 From: David Hegland Date: Thu, 6 Jun 2024 07:30:43 -0500 Subject: [PATCH] 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. --- autoload/tagbar.vim | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 93cad31..9808377 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