branch: elpa/evil commit b32e00179538af9685ab7c31d46eea6dc40595d4 Author: matthew <matth0...@gmail.com> Commit: Tom Dalziel <33435574+tomd...@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 ()