File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -437,12 +437,17 @@ function! codefmt#GetYAPFFormatter() abort
437
437
let l: cmd = [l: executable , ' --lines=' . a: startline . ' -' . a: endline ]
438
438
let l: input = join (l: lines , " \n " )
439
439
440
- let l: result = maktaba#syscall#Create (l: cmd ).WithStdin (l: input ).Call (0 )
441
- let l: formatted = split (l: result .stdout, " \n " )
440
+ try
441
+ let l: result = maktaba#syscall#Create (l: cmd ).WithStdin (l: input ).Call ()
442
+ let l: formatted = split (l: result .stdout, " \n " )
443
+
444
+ let l: full_formatted = l: formatted
442
445
443
- let l: full_formatted = l: formatted
446
+ call maktaba#buffer#Overwrite (1 , line (' $' ), l: full_formatted )
447
+ catch /ERROR(ShellError):/
448
+ call maktaba#error#Shout (' Error formatting file: %s' , v: exception )
449
+ endtry
444
450
445
- call maktaba#buffer#Overwrite (1 , line (' $' ), l: full_formatted )
446
451
endfunction
447
452
448
453
return l: formatter
You can’t perform that action at this time.
0 commit comments