Skip to content

Commit 0ad1941

Browse files
committed
Execute in normal state should cancel insert count
1 parent 457ac07 commit 0ad1941

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

evil-commands.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4664,6 +4664,7 @@ This var stores the eol position, so it can be restored when necessary.")
46644664
(setq evil-move-cursor-back ',evil-move-cursor-back
46654665
evil-move-beyond-eol ',evil-move-beyond-eol)))
46664666
'post-command-hook)
4667+
(setq evil-insert-count nil)
46674668
(setq evil--execute-normal-eol-pos (when (eolp) (point)))
46684669
(setq evil-move-cursor-back nil)
46694670
(evil-normal-state)

evil-tests.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,12 @@ with `M-x evil-tests-run'"))
342342
:state insert
343343
"abc[]defg"
344344
("\C-oRfoo")
345-
"abcfoog"))))
345+
"abcfoog"))
346+
(ert-info ("Insert count is ignored")
347+
(evil-test-buffer
348+
"[]"
349+
("2i" "abcdef" "\C-o~" "g" [escape])
350+
"abcdeF[g]"))))
346351

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

0 commit comments

Comments
 (0)