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

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

[nongnu] elpa/iedit 44601e01fa 269/301: fix an issue with electric pair


From: ELPA Syncer
Subject: [nongnu] elpa/iedit 44601e01fa 269/301: fix an issue with electric pair
Date: Mon, 10 Jan 2022 22:59:09 -0500 (EST)

branch: elpa/iedit
commit 44601e01fa197d94e67048d70894775781f2e0ea
Author: Victor <victorhge@gmail.com>
Commit: Victor <victorhge@gmail.com>

    fix an issue with electric pair
    
    The new electric-pair-mode in Emacs 27.1 involved "undo" when it is
    inserting "()".  "undo" was not recorded in the 'iedit-after-change-list'
---
 iedit-lib.el | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/iedit-lib.el b/iedit-lib.el
old mode 100644
new mode 100755
index 970d16bacc..7d56a24391
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
 
 ;; Copyright (C) 2010, 2011, 2012 Victor Ren
 
-;; Time-stamp: <2020-08-26 19:29:09 Victor Ren>
+;; Time-stamp: <2020-10-31 11:22:18 Victor Ren>
 ;; Author: Victor Ren <victorhge@gmail.com>
 ;; Keywords: occurrence region simultaneous rectangle refactoring
 ;; Version: 0.9.9.9
@@ -260,15 +260,14 @@ cursors."
           (master (point)))
       (save-excursion
         (dolist (occurrence iedit-occurrences-overlays)
-         (goto-char (+ (overlay-start occurrence) offset))
-         (unless (= master (point))
-           (mc/create-fake-cursor-at-point))))
+                 (goto-char (+ (overlay-start occurrence) offset))
+                 (unless (= master (point))
+                       (mc/create-fake-cursor-at-point))))
       (run-hooks 'iedit-aborting-hook)
       (multiple-cursors-mode 1)))
-  ;; `multiple-cursors-mode' runs `post-command-hook' function for all the
-  ;; cursors. `post-command-hook' is setup in `iedit-switch-to-mc-mode' So the
-  ;; function is executed after `iedit-switch-to-mc-mode'. It is not expected.
-  ;; `mc/cmds-to-run-once' is for skipping this.
+  ;; `multiple-cursors-mode' runs `post-command-hook' function on all the
+  ;; cursors for updating them .  `iedit-switch-to-mc-mode' is not supposed to
+  ;; be run in mc mode.  `mc/cmds-to-run-once' is for skipping this.
   (add-to-list 'mc/cmds-to-run-once 'iedit-switch-to-mc-mode)
   (define-key iedit-occurrence-keymap-default (kbd "M-M") 
'iedit-switch-to-mc-mode))
 
@@ -483,9 +482,10 @@ occurrences. Refer to `modification-hooks' for more 
details.
 Current supported edits are insertion, yank, deletion and
 replacement.  If this modification is going out of the
 occurrence, it will abort Iedit mode."
-  (if undo-in-progress
-      ;; If the "undo" change make occurrences different, it is going to mess 
up
-      ;; occurrences.  So a length check will be done after undo command is 
executed.
+  (if (and undo-in-progress (null iedit-after-change-list))
+      ;; If the "undo" change (not part of another command) make occurrences
+      ;; different, it is going to mess up occurrences.  So a length check will
+      ;; be done after undo command is executed.
       (when (not iedit-post-undo-hook-installed)
         (add-hook 'post-command-hook 'iedit-post-undo nil t)
         (setq iedit-post-undo-hook-installed t))
@@ -617,7 +617,7 @@ the buffer."
          (when ov (setq pos (overlay-start ov)))
          (if (and ov
                           (setq previous-overlay (iedit-find-overlay-at-point 
(1- pos) 'iedit-occurrence-overlay-name)))
-                 (setq pos (overlay-start previous-overlay))
+                 (setq pos (overlay-start previous-overlay)) ;conjoined
                (setq pos (previous-single-char-property-change pos 
'iedit-occurrence-overlay-name))
                (setq pos (previous-single-char-property-change pos 
'iedit-occurrence-overlay-name))))
     ;; At the start of the first occurrence



reply via email to

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