From e6bf56a73054b1e6170a8a11da1ebef8daa14c10 Mon Sep 17 00:00:00 2001 From: Tom Dalziel Date: Thu, 4 Apr 2024 11:14:41 +0200 Subject: [PATCH] evil-undo is a jump command Partially fixes #1878 --- evil-commands.el | 1 + evil-tests.el | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/evil-commands.el b/evil-commands.el index 7938b93a..e3af076f 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -1753,6 +1753,7 @@ Add (add-hook 'evil-local-mode-hook 'turn-on-undo-tree-mode) to your init file f (evil-define-command evil-undo (count) "Undo COUNT changes in buffer using `evil-undo-function'." :repeat abort + :jump t (interactive "*p") (evil--check-undo-system) (funcall evil-undo-function count)) diff --git a/evil-tests.el b/evil-tests.el index 259c6ff9..f22a6694 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -9779,6 +9779,20 @@ when an error stops the execution of the macro" ("uu") "line 1\n[l]ine 2\nline 3"))) +(ert-deftest evil-test-undo-jump () + "Test that undo adds to the jump list." + :tags '(evil) + (let ((evil--jumps-buffer-targets "\\*\\(new\\|scratch\\|test\\)\\*")) + (ert-info ("Undo adds to the jump list") + (evil-test-buffer + "alpha [b]ravo charlie delta" + ("dw" "w") + "alpha charlie [d]elta" + ("u") + "alpha [b]ravo charlie delta" + ("``") + "alpha bravo charlie [d]elta")))) + (ert-deftest evil-test-visual-update-x-selection () "Test `evil-visual-update-x-selection'." :tags '(evil)