Closed orlp closed 9 years ago
It might be also correct (and even better) to pattern match on Vim(normal)
, I just took the most conservative route possible.
Can you change call repeat#run
to exe repeat#run
and the end of the function to look like:
catch ...
let v:errmsg = ...
return 'echoerr v:errmsg'
endtry
return ''
This makes the error more like a real Vim error.
@tpope Ok. Do you think I should use the conservative (but possibly incomplete) E-numbers just for searching, or Vim(normal)
to catch?
Also, it seems not necessary to set v:errmsg
ourselves.
I think Vim(normal)
is fine.
Setting v:errmsg
is just a convenient global to make it available in the outer scope.
I'm not too familiar with Vim's scoping rules, but everything works fine by default - v:errmsg
is already set.
Are you suggesting I should do let v:errmsg = v:errmsg
?
In the past I recall having to explicitly massage v:exception
to get a suitable v:errmsg
. But if you can get away without it, go for it.
@tpope Done.
@tpope It's been a while now, can this be merged or do I need to change something?
@tpope Thanks!
Solves https://github.com/tpope/vim-repeat/issues/38 , at least for searching (I tried to be conservative in filtering error messages - more can be added).