emacs-diffs
[Top][All Lists]
Advanced

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

master b10a6fd5bb: * lisp/isearch.el (isearch-delete-char): Improve fix


From: Juri Linkov
Subject: master b10a6fd5bb: * lisp/isearch.el (isearch-delete-char): Improve fix for bug#52248.
Date: Tue, 28 Jun 2022 13:21:04 -0400 (EDT)

branch: master
commit b10a6fd5bb04675d531578accbd3609e29e8ad51
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/isearch.el (isearch-delete-char): Improve fix for bug#52248.
    
    When reaching the top of the stack where isearch-other-end is nil,
    still close unnecessary overlays for the previous position.
    (isearch-close-unnecessary-overlays): Rename arg BEG for consistency.
---
 lisp/isearch.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 0624858993..34c3665bd8 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2522,11 +2522,12 @@ If no input items have been entered yet, just beep."
   (if (null (cdr isearch-cmds))
       (ding)
     (isearch-pop-state))
-  ;; When going back to the hidden match, reopen it.
-  (when (and (eq search-invisible 'open) isearch-hide-immediately
-             isearch-other-end)
-    (isearch-range-invisible (min (point) isearch-other-end)
-                             (max (point) isearch-other-end)))
+  ;; When going back to the hidden match, reopen it and close other overlays.
+  (when (and (eq search-invisible 'open) isearch-hide-immediately)
+    (if isearch-other-end
+        (isearch-range-invisible (min (point) isearch-other-end)
+                                 (max (point) isearch-other-end))
+      (isearch-close-unnecessary-overlays (point) (point))))
   (isearch-update))
 
 (defun isearch-del-char (&optional arg)
@@ -3756,11 +3757,11 @@ Optional third argument, if t, means if fail just 
return nil (no error).
 ;; Verify if the current match is outside of each element of
 ;; `isearch-opened-overlays', if so close that overlay.
 
-(defun isearch-close-unnecessary-overlays (begin end)
+(defun isearch-close-unnecessary-overlays (beg end)
   (let ((overlays isearch-opened-overlays))
     (setq isearch-opened-overlays nil)
     (dolist (ov overlays)
-      (if (isearch-intersects-p begin end (overlay-start ov) (overlay-end ov))
+      (if (isearch-intersects-p beg end (overlay-start ov) (overlay-end ov))
          (push ov isearch-opened-overlays)
        (let ((fct-temp (overlay-get ov 'isearch-open-invisible-temporary)))
          (if fct-temp



reply via email to

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