Skip to content

Commit

Permalink
Remove unnecessary post-command hook run
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Jul 21, 2024
1 parent 404875a commit 30ebe6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
3 changes: 1 addition & 2 deletions evil-states.el
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ Handles the repeat-count of the insertion command."
(move-to-column col t)
(funcall col))
(dotimes (_ (or evil-insert-count 1))
(evil-execute-repeat-info (cdr evil-insert-repeat-info))))))
(run-hooks 'post-command-hook))))))
(evil-execute-repeat-info (cdr evil-insert-repeat-info)))))))))))
(and evil-want-fine-undo (evil-end-undo-step)))

;;; Visual state
Expand Down
19 changes: 17 additions & 2 deletions evil-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,17 @@ New Tex[t]
((kbd "C-v") "jj$AXXX" [escape])
"line 1line 1line 1XX[X]\nline 2XXX\nline 3line 3XXX\n")))

(ert-deftest evil-visual-block-insert ()
"Test inserting (prepending) in visual block."
:tags '(evil visual insert)
(ert-info ("Prepend and repeat")
(evil-test-buffer
"[a]lpha\nbravo\ncharlie\ndelta\necho\nfoxtrot\ngolf"
("\C-v" "jj" "I" "zulu" [escape])
"zul[u]alpha\nzulubravo\nzulucharlie\ndelta\necho\nfoxtrot\ngolf"
("/delta" [return] ".")
"zulualpha\nzulubravo\nzulucharlie\nzul[u]delta\nzuluecho\nzulufoxtrot\ngolf")))

(ert-deftest evil-test-repeat-digraph ()
"Test repeat of insertion of a digraph."
:tags '(evil digraph repeat)
Expand Down Expand Up @@ -9734,7 +9745,9 @@ parameter set."
"new buffe[r]")
(delete-file temp-file)
(let ((buf (file-name-nondirectory temp-file)))
(when (get-buffer buf) (kill-buffer buf))))))
(when (get-buffer buf)
(with-current-buffer buf (set-buffer-modified-p nil))
(kill-buffer buf))))))
(ert-info ("Jump multiple times between files")
(let ((a (make-temp-file "evil-aa-" nil nil "evil-bb\n\nthis is a"))
(b (make-temp-file "evil-bb-" nil nil "evil-cc\n\nthis is b"))
Expand All @@ -9752,7 +9765,9 @@ parameter set."
"this is c")
(dolist (f (list a b c))
(let ((buf (file-name-nondirectory f)))
(when (get-buffer buf) (kill-buffer buf)))
(when (get-buffer buf)
(with-current-buffer buf (set-buffer-modified-p nil))
(kill-buffer buf)))
(delete-file f)))))))

(ert-deftest evil-test-find-file ()
Expand Down

0 comments on commit 30ebe6d

Please sign in to comment.