2012/11/29 Ben Fritz <[email protected]>:
> On Wednesday, November 28, 2012 4:18:41 PM UTC-6, Techlive Zheng wrote:
>>
>> What I want accomplish is something like a error listener, if certain
>>
>> type of error raises, then the defined action will be triggerd. The
>>
>> end user do not need to care about using `try...catch` in their
>>
>> command, they just fire up any command they want, and let script
>>
>> handle the rest.
>
> This is a much better explanation of what you wanted. Unfortunately I cannot 
> think of any way to accomplish what you want. What are you trying to 
> accomplish with your script? I.e. what task are you trying to do that you 
> think you need a global always-active error listener?
I am devloping a plugin that has a window open to track editable
buffer's status. If the last file in the argulist has not been edited,
then the `:quit` will fail. I use `QuitPre` to close my plugin window
before the ':quit' command, but if it fails due the last file has not
been edited, I am hoping to reopen the plugin window, but I can't find
a way to do that, so I hope there might be some global error handler.
>
>> This is easy for script-defined command, but how to
>>
>> catch a error that a system command raises?
>
> The way to catch errors is with try...catch. I'm not sure how a script 
> defined command makes this any easier to do, unless you mean the script 
> defined command can do try...catch internally.
Yes, that is what I mean.
>
> By the way, this question is about using Vim, not developing the Vim code, so 
> questions like it would be better asked on vim_use.
Soryy for this, I have posted it in the vim_use ML couple days ago
with no reponse, it is more likely a feature request, so I posted it
here again.
>
> --
> 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

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