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

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

[nongnu] elpa/iedit a8ab03848d 158/301: complete iedit-toggle-selection


From: ELPA Syncer
Subject: [nongnu] elpa/iedit a8ab03848d 158/301: complete iedit-toggle-selection
Date: Mon, 10 Jan 2022 22:58:59 -0500 (EST)

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

    complete iedit-toggle-selection
---
 iedit.el | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/iedit.el b/iedit.el
index 0a4e953e16..ebc8ffaeda 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2010, 2011, 2012 Victor Ren
 
-;; Time-stamp: <2013-01-02 23:21:38 Victor Ren>
+;; Time-stamp: <2013-02-08 21:48:50 Victor Ren>
 ;; Author: Victor Ren <victorhge@gmail.com>
 ;; Keywords: occurrence region simultaneous refactoring
 ;; Version: 0.97
@@ -366,7 +366,7 @@ Keymap used within overlays:
       (iedit-cleanup))
     (iedit-start regexp (point-min) (point-max))
     ;; TODO: reconsider how to avoid the loop in iedit-same-length
-    (cond ((not iedit-occurrences-overlays) 
+    (cond ((not iedit-occurrences-overlays)
            (message "No matches found")
            (iedit-done))
           ((not (iedit-same-length))
@@ -475,15 +475,19 @@ the initial string globally."
   (let ((ov (iedit-find-current-occurrence-overlay)))
     (if ov
         (iedit-restrict-region (overlay-start ov) (overlay-end ov) t)
-      (goto-char (if (> (point)(length iedit-initial-string-local))
-                     ( - (point) (length iedit-initial-string-local))
-                   (point-min)))
-      (iedit-add-next-occurrence-overlay (iedit-regexp-quote 
iedit-initial-string-local))
-      (setq iedit-mode (propertize
-                    (concat " Iedit:" (number-to-string
-                                       (length iedit-occurrences-overlays)))
-                    'face 'font-lock-warning-face))
-      (force-mode-line-update))))
+      (let ((current-occurrence-string (iedit-current-occurrence-string)))
+        (when (not (null current-occurrence-string))
+          (save-excursion
+            (goto-char (if (> (point) (length current-occurrence-string))
+                           ( - (point) (length current-occurrence-string))
+                         (point-min)))
+            (iedit-add-next-occurrence-overlay
+             (iedit-regexp-quote current-occurrence-string)))
+          (setq iedit-mode (propertize
+                            (concat " Iedit:" (number-to-string
+                                               (length 
iedit-occurrences-overlays)))
+                            'face 'font-lock-warning-face))
+          (force-mode-line-update))))))
 
 (defun iedit-restrict-function(&optional arg)
   "Restricting Iedit mode in current function."



reply via email to

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