Status messages turn into stack traces.
orlp opened this issue · 3 comments
Let's say we entered a non-existing pattern and press n
. This produces a simple clean status message:
E486: Pattern not found: \vfoobar
However if we'd do the same through vim-repeat (:call repeat#set("n")<CR>.
) we get an ugly stack trace:
Error detected while processing function repeat#run:
line 17:
E486: Pattern not found: \vfoobar
Press ENTER or type command to continue
Reproduction steps:
$ wget https://raw.githubusercontent.com/tpope/vim-repeat/master/autoload/repeat.vim
$ vim -u NONE
:set nocompatible
:source repeat.vim
/foobar
:call repeat#set("n")
.
n
is a motion, not a change. .
would never repeat an n
on its own. Why are you passing it to repeat#set()
?
This is a minimalized example. I stumbled upon this because I am using n
within a bigger mapping that changes the match the cursor is on and move to the next match, or moves to the next match if the cursor is currently not on a match and do nothing else. This is a demo:
This is a regression by the way, for example vim-repeat at this commit didn't have this issue. I haven't confirmed yet whether this is the latest commit where it worked properly, still working on narrowing it down.
I did some more experimenting, and it seems that this commit introduced this bug.