Loading ...
Sorry, an error occurred while loading the content.
 

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

Expand Messages
  • Ingo Karkat
    Hello, Two questions on Stack Overflow http://stackoverflow.com/questions/9466795/vim-using-an-external-command-and-handling-errors
    Message 1 of 2 , Dec 1, 2012
      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

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Ingo Karkat
      Hello, Two questions on Stack Overflow http://stackoverflow.com/questions/9466795/vim-using-an-external-command-and-handling-errors
      Message 2 of 2 , Dec 1, 2012
        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.

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.