Q: Why is there no error handling on 'formatprg' and 'indentprg'?

130 views
Skip to first unread message

Ingo Karkat

unread,
Dec 1, 2012, 7:01:53 AM12/1/12
to vim...@googlegroups.com
Hello,

Two questions on Stack Overflow


http://stackoverflow.com/questions/9466795/vim-using-an-external-command-and-handling-errors

http://stackoverflow.com/questions/13658696/vim-how-to-redirect-formatprg-errors-to-echoerr

inquire why, when the external command in 'formatprg' or 'indentprg' fails, the
error output is inserted into the buffer (okay, this is due to the default
'shellredir' including 2>&1), instead of keeping the buffer contents and showing
the returned stderr output via :echoerr.

Although the bad substitution can be easily undone, I wonder why there isn't a
more convenient behavior; I cannot imagine a situation where modifying the text
through an executable that returns an exit status != 0 is desirable. Shouldn't =
and gq observe v:shell_error and abort the command when there's an error?!

-- regards, ingo

PS: Sorry if you received this twice; my first message somehow didn't appear on
the list over lunchtime.

Ingo Karkat

unread,
Dec 1, 2012, 6:39:31 AM12/1/12
to Vim Developers
Reply all
Reply to author
Forward
0 new messages