From 55c6d76deba107852ffcef771f76abaadf468cc0 Mon Sep 17 00:00:00 2001 From: Gordon Bailey Date: Wed, 24 May 2023 11:27:57 +0200 Subject: [PATCH] Fix bug in ktfmt availability check 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). --- autoload/codefmt/ktfmt.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/codefmt/ktfmt.vim b/autoload/codefmt/ktfmt.vim index c250e4f..0bbe153 100644 --- a/autoload/codefmt/ktfmt.vim +++ b/autoload/codefmt/ktfmt.vim @@ -45,7 +45,7 @@ function! codefmt#ktfmt#GetFormatter() abort let l:success = 0 try let l:result = maktaba#syscall#Create(l:cmd + ['-']).Call() - let l:success = v:shell_error != 0 + let l:success = v:shell_error == 0 catch /ERROR(ShellError)/ call maktaba#error#Warn( \ 'ktfmt unavailable, check jar file in `%s -`: %s',