1. Frank Fischer
  2. evil
Issue #308 resolved

Undo in region with V and nil evil-move-cursor-back

epich
created an issue

Let /tmp/evil-undo-region.el have content:

  ;; Initialize evil
  (add-to-list 'load-path "~/.emacs.d/evil")
  (require 'evil)
  (evil-mode 1)
  (setq evil-move-cursor-back nil)

Run emacs -Q --load /tmp/evil-undo-region.el some-file

Append a char at the end of a line in some-file. Use V to highlight the same line, move region down a few lines to be sure the added letter is well within the region. Undo. The added char is not undone.

Comments (2)

  1. Frank Fischer repo owner

    Do not mark undo/redo as motions but as non-repeatable (fix #308).

    Declaring those functions as motions causes the region to be not set up to match the visual selection before the command is run (because motions do not care for the region but for the correct position of point). However, undo/redo may be used with an active region, so it is better to declare them as normal commands that are called with the correct region but may not be repeated.

    → <<cset 97cc4e8f9eed>>

  2. Frank Fischer repo owner

    Do not mark undo/redo as motions but as non-repeatable (fix #308).

    Declaring those functions as motions causes the region to be not set up to match the visual selection before the command is run (because motions do not care for the region but for the correct position of point). However, undo/redo may be used with an active region, so it is better to declare them as normal commands that are called with the correct region but may not be repeated.

    → <<cset 97cc4e8f9eed>>

  3. Log in to comment