Tuesday, September 1, 2009

Re: goto line depending on exit code of filter

On 01/09/09 12:18, bill lam wrote:
>
> On Tue, 01 Sep 2009, Tony Mechelynck wrote:
>> external program generate the required number as a return code: IIRC,
>> return codes are limited to one byte, and those above 127 may have a
>> special meaning (generated by the OS maybe).
>
> Tony, you are correct. I don't why it seemed to work last time I
> tested.
>
> How can I store content of the current buffer and restore it in case
> of error? like the following pseudo code
>
> let tmp=%
> %!filter
> if v:xhell_error | set %=tmp | endif
>

what about (untested)

%!filter
if v:shell_error
undo
endif

?

If it doesn't work you can always do

w! /temp/file
%!filter
if v:shell_error
e! /temp/file
saveas #
endif

but it isn't very elegant.


Best regards,
Tony.
--
President Reagan has noted that there are too many economic pundits and
forecasters and has decided on an excess prophets tax.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments: