Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evil-undo is a jump command #1879

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading