Skip to content

Commit 16909d9

Browse files
committed
Split on space when checking IsAvailable
1 parent 1573786 commit 16909d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

autoload/codefmt/ktfmt.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ function! codefmt#ktfmt#GetFormatter() abort
2828
\ 'in your .vimrc' }
2929

3030
function l:formatter.IsAvailable() abort
31-
let l:exec = s:plugin.Flag('ktfmt_executable')
32-
if executable(l:exec)
31+
let l:exec = split(s:plugin.Flag('ktfmt_executable'), '\\\@<! ')
32+
if empty(l:exec)
33+
return 0
34+
endif
35+
if executable(l:exec[0])
3336
return 1
34-
elseif !empty(l:exec) && l:exec isnot# 'ktfmt'
37+
elseif !empty(l:exec[0]) && l:exec[0] isnot# 'ktfmt'
3538
" The user has specified a custom formatter command. Hope it works.
3639
return 1
3740
else

0 commit comments

Comments
 (0)