GNU bug report logs -
#39680
27.0.60; electric-pair-mode broken by undo
Previous Next
Full log
Message #29 received at control <at> debbugs.gnu.org (full text, mbox):
unarchive 39680
thanks
João Távora <joaotavora <at> gmail.com> writes:
> If you see this consistently failing when you revert the earlier fix and
> passing now, I'd just add it to test/lisp/electric-tests.el.
Thank you for prompting me to check; infuriatingly, this test does *not*
fail when reverting Stefan's fix, although the manual recipe (39680#5)
fails consistently. Obviously I'm missing something and the test needs
more work.
> A short
> docstring summarily explaining what is being tested is useful. Or maybe
> not, I think can read it without it.
FWIW I've added a docstring and moved the test to electric-tests.el,
right after the "backspacing" tests.
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 6334c62a31..d259f31a4c 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -545,6 +545,22 @@ js-mode-braces-with-layout-and-indent
(goto-char 2)
(electric-pair-delete-pair 1)
(should (equal "" (buffer-string))))))
+
+;;; Undoing
+(ert-deftest electric-pair-undo-unrelated-state ()
+ "Make sure `undo' does not get confused by `electric-pair-mode' (bug#39680)."
+ (with-temp-buffer
+ (buffer-enable-undo)
+ (electric-pair-local-mode)
+ (let ((last-command-event ?\())
+ (self-insert-command 1))
+ (undo-boundary)
+ (insert "a")
+ (undo-boundary)
+ (call-interactively #'undo)
+ (let ((last-command-event ?\())
+ (self-insert-command 1))
+ (should (string= (buffer-string) "(())"))))
;;; Electric newlines between pairs
This bug report was last modified 5 years and 2 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.