Skip to content

Commit 09ee74c

Browse files
authored
Fix bug in ktfmt availability check (#219)
When trying to use this locally, I was getting repeated errors that ktfmt was not available. Reversing the conditional here makes everything work correctly for me (on Linux), and also makes sense (success of a command line tool is indicated by return code equal to 0).
1 parent db7631c commit 09ee74c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/codefmt/ktfmt.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function! codefmt#ktfmt#GetFormatter() abort
4545
let l:success = 0
4646
try
4747
let l:result = maktaba#syscall#Create(l:cmd + ['-']).Call()
48-
let l:success = v:shell_error != 0
48+
let l:success = v:shell_error == 0
4949
catch /ERROR(ShellError)/
5050
call maktaba#error#Warn(
5151
\ 'ktfmt unavailable, check jar file in `%s -`: %s',

0 commit comments

Comments
 (0)