evil icon indicating copy to clipboard operation
evil copied to clipboard

[num] goto-last-change doesn't work correctly

Open JiaweiChenC opened this issue 2 years ago • 3 comments

Issue type

  • Bug report

Environment

Emacs version: GNU Emacs 28.1 (build 2, aarch64-apple-darwin21.5.0, NS appkit-2113.50 Version 12.4 (Build 21F79))

Operating System: macOS Sierra Evil version: 1.15.0 Evil installation type: MELPA Graphical/Terminal: Graphical Tested in a make emacs session (see CONTRIBUTING.md): Yes

Reproduction steps

  • Start Emacs
  • Type a random sentence, for example: asdfghjkl
  • Move curse to somewhere before, e.g., move curse to (d)
  • add some words: asd111111fghjkl
  • type 2g; (only goes to the last change, the same effect as g;, num arg doesn't work)

Expected behavior

In the above example, 2g; will go to the end of the sentence

Actual behavior

only goes to the last change, the same as g;

Further notes

JiaweiChenC avatar Jul 13 '22 04:07 JiaweiChenC

As per the docstring, a count changes the "span" used, not the number of steps to take. I agree this differs from vim's behaviour. @wasamasa - can you expand on why this choice was made?

tomdl89 avatar Jul 17 '22 15:07 tomdl89

No, I cannot. Evil has always used goto-chg.el to provide this functionality and I do not see any evidence for the behavior ever having been different. In fact, I wasn't even aware there is a prefix argument for g;.

I did write an email to the contact info in the original file and never received a response. Therefore I'm pessimistic about finding out why this choice was made.

wasamasa avatar Jul 17 '22 15:07 wasamasa

Ah, thanks anyway - worth a shot. @JiaweiChenC I'll leave this open, but I can't promise I'll take a look at a fix any time soon. I think I'd welcome a PR on this, as I'm highly doubtful many rely on the current behaviour.

tomdl89 avatar Jul 17 '22 21:07 tomdl89