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

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

[nongnu] elpa/evil b32e001795: Fix for issue #730 appending to macro fai


From: ELPA Syncer
Subject: [nongnu] elpa/evil b32e001795: Fix for issue #730 appending to macro fails
Date: Mon, 9 May 2022 16:58:06 -0400 (EDT)

branch: elpa/evil
commit b32e00179538af9685ab7c31d46eea6dc40595d4
Author: matthew <matth0204@gmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>

    Fix for issue #730 appending to macro fails
---
 evil-common.el |  3 +++
 evil-tests.el  | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/evil-common.el b/evil-common.el
index d755120d84..672e34381c 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -2230,6 +2230,9 @@ The following special registers are supported.
     (cond
      ((not content)
       (set-register register text))
+     ((not (stringp content))
+      ;; if the register does not contain a string treat it as a vector
+      (set-register register (vconcat content text)))
      ((or (text-property-not-all 0 (length content)
                                  'yank-handler nil
                                  content)
diff --git a/evil-tests.el b/evil-tests.el
index d38ee9ea50..d8951194ed 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -9355,6 +9355,16 @@ when an error stops the execution of the macro"
       ;; should not raise an "Selecting deleted buffer" error
       (evil-visual-update-x-selection buf))))
 
+(ert-deftest evil-test-append-to-kbd-macro ()
+  "Test if evil can append to a keyboard macro."
+  :tags '(evil append to kbd-macro)
+  (ert-info ("When kbd-macro ends in <escape>")
+    (evil-test-buffer
+     (evil-set-register ?a (vconcat "ainserted text" [escape]))
+     (evil-set-register ?A (vconcat "a appended text" [escape]))
+     ("@a")
+     "inserted text appended tex[t]")))
+
 ;;; Core
 
 (ert-deftest evil-test-initial-state ()



reply via email to

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