Currently it's a bit difficult to work with vim-shfmt when shfmt returns an error.
Consider the follwing script named test.sh
#!/bin/sh
foo="${$bar}"
when using vim-shfmt on save I'll get the following error output:
Error detected while processing BufWrite Autocommands for "*.sh"..function shfmt#shfmt:
line 11:
Shfmt returned an error (often due to wrong syntax). Undoing changes.
2 more lines; before #4 0 seconds ago
Shfmt returned an error (often due to wrong syntax). Undoing changes.
"test.sh" 3L, 25B written
Press ENTER or type command to continue
when using shfmt from the cmdline I'll get:
shfmt test.sh
test.sh: test.sh:3:9: $ cannot be followed by a word
shfmt correctly shows the line where the first first error appeared.
vim-shfmt should show the error returned by shfmt.
Automatically jumping to this line would be nice too.
Hi @z0mbix ,
thanks for your work on
vim-shfmt
.Currently it's a bit difficult to work with
vim-shfmt
whenshfmt
returns an error.Consider the follwing script named test.sh
when using
vim-shfmt
on save I'll get the following error output:when using
shfmt
from the cmdline I'll get:shfmt
correctly shows the line where the first first error appeared.vim-shfmt
should show the error returned byshfmt
. Automatically jumping to this line would be nice too.