diff options
author | Juri Linkov <juri@linkov.net> | 2022-06-28 20:20:21 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2022-06-28 20:20:21 +0300 |
commit | b10a6fd5bb04675d531578accbd3609e29e8ad51 (patch) | |
tree | 6de38847684e21af0b8112ddbaaeed22fed5fdd1 /lisp/isearch.el | |
parent | 7580f3f4875921b6d88e6ea7ed34c2493af305d1 (diff) | |
download | emacs-b10a6fd5bb04675d531578accbd3609e29e8ad51.tar.gz emacs-b10a6fd5bb04675d531578accbd3609e29e8ad51.tar.bz2 emacs-b10a6fd5bb04675d531578accbd3609e29e8ad51.zip |
* 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.
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r-- | lisp/isearch.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 0624858993d..34c3665bd8c 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 |