Skip to content

Commit f0fdfef

Browse files
authored
Fix #1460 where cursor is misplaced after C-o at eol (#1461)
1 parent 8dc0ccd commit f0fdfef

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

evil-commands.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4650,10 +4650,12 @@ if the previous state was Emacs state."
46504650
`(progn
46514651
(with-current-buffer ,(current-buffer)
46524652
(evil-change-state ',evil-state)
4653-
(setq evil-move-cursor-back ',evil-move-cursor-back)))
4653+
(setq evil-move-cursor-back ',evil-move-cursor-back
4654+
evil-move-beyond-eol ',evil-move-beyond-eol)))
46544655
'post-command-hook)
46554656
(setq evil-move-cursor-back nil)
46564657
(evil-normal-state)
4658+
(setq evil-move-beyond-eol t)
46574659
(evil-echo "Switched to Normal state for the next command ..."))
46584660

46594661
(defun evil-stop-execute-in-emacs-state ()

evil-tests.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,13 @@ with `M-x evil-tests-run'"))
306306
("\C-oA")
307307
(ert-info ("Should return to insert state after insert state command")
308308
(should (evil-insert-state-p)))
309-
("bcdef[]\n"))))
309+
("bcdef[]\n"))
310+
(ert-info ("Cursor is placed correctly afterwards")
311+
(evil-test-buffer
312+
:state insert
313+
"abcdefg[]"
314+
("\C-o~")
315+
"abcdefG[]"))))
310316

311317
(defun evil-test-suppress-keymap (state)
312318
"Verify that `self-insert-command' is suppressed in STATE"

0 commit comments

Comments
 (0)