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

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

[nongnu] elpa/iedit 8d58171240 145/301: bugfix for iedit-hide-unmatched-


From: ELPA Syncer
Subject: [nongnu] elpa/iedit 8d58171240 145/301: bugfix for iedit-hide-unmatched-lines
Date: Mon, 10 Jan 2022 22:58:58 -0500 (EST)

branch: elpa/iedit
commit 8d581712403c7f3b9af2ec8c8c753e2fffe5cffe
Author: mbneedham <mbneedham@gmail.com>
Commit: mbneedham <mbneedham@gmail.com>

    bugfix for iedit-hide-unmatched-lines
    
    fixed bug where iedit-hide-unmatched-lines goes
    into an infinite loop if two matching lines are
    exactly context-lines apart
---
 iedit-lib.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/iedit-lib.el b/iedit-lib.el
index 0b7d7b305c..fcc78bbb56 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -521,14 +521,18 @@ value of `iedit-occurrence-context-lines' is used for 
this time."
     (save-excursion
       (iedit-first-occurrence)
       (while (/= (point) (point-max))
-        (forward-line (- context-lines))
-        (let ((line-beginning (line-beginning-position)))
-          (if (> line-beginning prev-occurrence-end)
-              (push  (list prev-occurrence-end (1- line-beginning)) 
unmatched-lines)))
+        (let ((current-start (point)))
+          (forward-line (- context-lines))
+          (let ((line-beginning (line-beginning-position)))
+            (if (> line-beginning prev-occurrence-end)
+                (push  (list prev-occurrence-end (1- line-beginning)) 
unmatched-lines)))        
+          (goto-char current-start))
         ;; goto the end of the occurrence
         (goto-char (next-single-char-property-change (point) 
'iedit-occurrence-overlay-name))
-        (forward-line context-lines)
-        (setq prev-occurrence-end (line-end-position))
+        (let ((current-end (point)))
+          (forward-line context-lines)
+          (setq prev-occurrence-end (1+ (line-end-position)))
+          (goto-char current-end))
         ;; goto the beginning of next occurrence
         (goto-char (next-single-char-property-change (point) 
'iedit-occurrence-overlay-name)))
       (if (< prev-occurrence-end (point-max))



reply via email to

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