On Tue, 12 Apr 2011, Rostyslaw Lewyckyj wrote:
Just for reference, in case this is in any way system dependant!
I'm on a Win 7 x 64bit ultimate OS.
My vim is a straight download and unmodified install from vim.org.
Below are included a sample file xxx, and a sample script zzz.
[Aside]
Please come up with smaller examples. For this one:
==> xxx <==
aaaaa
bbbbb
ccccc
===========
==> zzz <==
try
g/notfound/d
catch /E486:/
echo 'this is not caught'
endtry
===========
If it weren't obvious where the error was occurring, you could
systematically add:
finish
to each line of the script, then seeing how far it makes it.
[/Aside]
This is one of the example cases for using :silent. See:
:help :sil
But, also, I found this note in the todo:
"""
8 ":g//" gives "Pattern not found error" with E486. Should not use
the error number, it's not a regular error message.
"""
So, I don't think it can be caught via try/catch.
Also, why are you setting marks 'a and 'b and using 'a,'b everywhere,
instead of just using 1 and $?
Plus 1,$ can be better written as: %
And the default range for the :g[lobal] command is 1,$ anyway. So, you
need not use any range at all.
" e.g. you wrote:
1mark a
$mark b
" ...etc...
'a,'bg/^ /d
" but you can just write:
g/^ /d
--
Best,
Ben
--
You received this message from the "vim_use" 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