On 9/21/07, Nikolai Weibull <[EMAIL PROTECTED]> wrote:
>
> On 9/21/07, Ben Schmidt <[EMAIL PROTECTED]> wrote:
>
> > Most commands do not take
> > variables/expressions as input directly but need to be constructed using the
> > :exe command. I don't see any good reason why :catch should differ.
>
> For one thing, :catch can't be :execute'd.
Yes, separate catch can't.
But you can 'exe'cute the whole try...endtry block -- as a workaround for you:
exe "try | echo nosuchvar | catch // | echo 'Caught' | endtry"
There in such a construct, you can use variable in place of catch regex.
Regarding your pursuit of the modification of catch -- my opinion is
that vimscript would gain if it had general mechanism to
substitute vars and expressions in any part of command.
Like $VAR workd in shell or [...] in tcl or Ctrl-R= in vim's own
commandline mode.
Such extension would cover any command not only catch.
Maybe existing {...} can be extended to expand in any part of the
command and contain any expression ?
At the very least, Ctrl-R= could be made to work for script lines, too.
Yakov
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---