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

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

[nongnu] elpa/evil-surround ee61a65200 144/175: Fix repeating tag change


From: ELPA Syncer
Subject: [nongnu] elpa/evil-surround ee61a65200 144/175: Fix repeating tag changes
Date: Mon, 9 Oct 2023 13:01:14 -0400 (EDT)

branch: elpa/evil-surround
commit ee61a652003538675e00042b99fd2c03aa43a746
Author: James N. V. Cash <james.nvc@gmail.com>
Commit: James N. V. Cash <james.nvc@gmail.com>

    Fix repeating tag changes
    
    To make repeating tag changes, need to record the output from the reading
    the new tag
---
 evil-surround.el           |  6 ++++--
 test/evil-surround-test.el | 10 ++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/evil-surround.el b/evil-surround.el
index 6a92d082cd..305ccf58d5 100644
--- a/evil-surround.el
+++ b/evil-surround.el
@@ -106,10 +106,12 @@ Each item is of the form (OPERATOR . OPERATION)."
   "The previously deleted LEFT region.")
 
 (defun evil-surround-read-from-minibuffer (&rest args)
-  (when evil-surround-record-repeat
+  (when (or evil-surround-record-repeat
+            (evil-repeat-recording-p))
     (evil-repeat-keystrokes 'post))
   (let ((res (apply #'read-from-minibuffer args)))
-    (when evil-surround-record-repeat
+    (when (or evil-surround-record-repeat
+              (evil-repeat-recording-p))
       (evil-repeat-record res))
     res))
 
diff --git a/test/evil-surround-test.el b/test/evil-surround-test.el
index 0ab98de36e..a93bd7a7c9 100644
--- a/test/evil-surround-test.el
+++ b/test/evil-surround-test.el
@@ -129,6 +129,16 @@
       "<span ngModel class=\"foo\" randomAngularDirective #anchor1>Bar</span>"
       ("cst<p>")
       "<p>Bar</p>"))
+  (ert-info ("optionally keep xml attributes: repeating")
+    (evil-test-buffer
+     :visual-start nil
+     :visual-end nil
+     "<div attr=\"foo\">Foo</div><div attr=\"bar\">Bar</div>"
+     (turn-on-evil-surround-mode)
+     ("cst<span")
+     "<span attr=\"foo\">Foo</span><div attr=\"bar\">Bar</div>"
+     ("fB.")
+     "<span attr=\"foo\">Foo</span><span attr=\"bar\">Bar</span>"))
   (ert-info ("repeat surrounding")
     (evil-test-buffer
       "[o]ne two three"



reply via email to

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