On Wednesday, November 28, 2012 4:05:18 PM UTC-6, Techlive Zheng wrote:
> I know we can use `try..catch` structure to customize error handling in 
> scripts, but is there any way to catch an error of user executed command not 
> scripts? E.g. if the last file in the argulist has not been edited, then 
> executing `quit` command would fail with error "E173: * more file to edit", 
> is it possible to catch such an error and do something with it int the script?

Have you tried using :try ... :catch like you would in a script?

:help :try gives these examples:

                :try | sleep 100 | catch /^Vim:Interrupt$/ | endtry
                :try | edit | catch /^Vim(edit):E\d\+/ | echo "error" | endtry

-- 
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

Raspunde prin e-mail lui