Nikolai Weibull wrote:

>Could :catch be allowed to take a variable containing a pattern
>instead of only literal patterns?  I have the following function
>
>" Turn the error-number NUMBER into a pattern that can be used in a :catch
>" expression to match that error when generated by Vim.
>function now#vim#error(number)
>  return '^Vim\%((\a\+)\)\=:E' . a:number
>endfunction
>
>which is meant to be used
>
>let now#vim#undefined_variable_error = now#vim#error(121)
>
>so that one can then later write
>
>try
>  ... variable ...
>catch now#vim#undefined_variable_error
>  ... other variable instead ...
>endtry
>
>  
>
Can you use an exe for this?  I admit I haven't tried it...
exe "catch ".NWvariable

Regards,
Chip Campbell



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

Raspunde prin e-mail lui