Skip to content

Commit

Permalink
evil-undo is a jump command
Browse files Browse the repository at this point in the history
Partially fixes #1878
  • Loading branch information
tomdl89 committed Apr 4, 2024
1 parent 88d073c commit 0251080
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions evil-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 14 additions & 0 deletions evil-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0251080

Please sign in to comment.