Skip to content

Status messages turn into stack traces. #38

Open

Description

@orlp

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")
.

Activity

  1. tpope commented on Jan 28, 2015

    @tpope
    Owner

    n is a motion, not a change. . would never repeat an n on its own. Why are you passing it to repeat#set()?

  2. orlp commented on Jan 28, 2015

    @orlp
    ContributorAuthor

    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:

    quick-replace 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.

  3. orlp commented on Jan 28, 2015

    @orlp
    ContributorAuthor

    I did some more experimenting, and it seems that this commit introduced this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions