emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil 404875a211: Fix: perf improvements broke macro repeat


From: ELPA Syncer
Subject: [nongnu] elpa/evil 404875a211: Fix: perf improvements broke macro repeatability. Restore it.
Date: Sun, 21 Jul 2024 12:59:42 -0400 (EDT)

branch: elpa/evil
commit 404875a2119adbe2c989ac660b06a37fd2f25240
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <tom_dl@hotmail.com>

    Fix: perf improvements broke macro repeatability. Restore it.
---
 evil-commands.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/evil-commands.el b/evil-commands.el
index 2e3a26a232..cd8a66d670 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -2510,6 +2510,14 @@ will be opened instead."
       (setq evil-macro-buffer (current-buffer)))
      (t (error "Invalid register `%s'" register)))))
 
+(defun evil-repeat-execute-macro (flag)
+  "Called to record a macro execution.
+FLAG is either `pre' or `post' if the function is called before resp.
+after executing the command."
+  (pcase flag
+    ('pre (evil-repeat-record (this-command-keys)))
+    ('post (evil-repeat-record (string evil-last-register)))))
+
 (evil-define-command evil-execute-macro (count macro)
   "Execute keyboard macro MACRO, COUNT times.
 When called with a non-numerical prefix \
@@ -2518,6 +2526,7 @@ COUNT is infinite. MACRO is read from a register
 when called interactively."
   :keep-visual t
   :suppress-operator t
+  :repeat evil-repeat-execute-macro
   (interactive
    (let (count macro register)
      (setq count (cond ((null current-prefix-arg) 1)
@@ -2554,7 +2563,8 @@ when called interactively."
         (evil-with-single-undo
           (let (pre-command-hook post-command-hook) ; For performance
             (combine-after-change-calls
-              (execute-kbd-macro macro count))))
+              (execute-kbd-macro macro count)
+              (setq this-command 'evil-execute-macro)))) ; For repeatability
       ;; enter Normal state if the macro fails
       (error
        (evil-normal-state)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]