[Top][All Lists]

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

[elpa] master f9e8116 344/399: swiper.el (swiper-isearch-action): Fix ou

From: Oleh Krehel
Subject: [elpa] master f9e8116 344/399: swiper.el (swiper-isearch-action): Fix outlines getting over-revealed
Date: Sat, 20 Jul 2019 14:57:54 -0400 (EDT)

branch: master
commit f9e811600940978f469bbe422f5308616d337f6e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    swiper.el (swiper-isearch-action): Fix outlines getting over-revealed
    * swiper.el (swiper-isearch-action): The change to
      `isearch-range-invisible' params is important here.
    (swiper-isearch): Clean up the overlays here, instead of in 
    Expected behavior after the fix: all outlines that were revealed are
    closed, either on finish or on abort. The exception is the outline
    that contains the point.
    Fixes #2119
 swiper.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/swiper.el b/swiper.el
index 7c645c2..70b0f55 100644
--- a/swiper.el
+++ b/swiper.el
@@ -679,6 +679,7 @@ When capture groups are present in the input, print them 
instead of lines."
               (bound-and-true-p reveal-mode))
     (reveal-mode -1))
   (lazy-highlight-cleanup t)
+  (setq isearch-opened-overlays nil)
   (when (bound-and-true-p evil-mode)
@@ -810,9 +811,6 @@ Matched candidates should have `swiper-invocation-face'."
   ;; force cleanup unless it's :unwind
    (if (eq ivy-exit 'done) lazy-highlight-cleanup t))
-  (save-excursion
-    (goto-char (point-min))
-    (isearch-clean-overlays))
   (when (timerp swiper--isearch-highlight-timer)
     (cancel-timer swiper--isearch-highlight-timer)
     (setq swiper--isearch-highlight-timer nil)))
@@ -1338,8 +1336,7 @@ that we search only for one character."
                (setq x (get-text-property 0 'point x))))
         (goto-char x)
-        (isearch-range-invisible (line-beginning-position)
-                                 (line-end-position))
+        (isearch-range-invisible (point) (1+ (point)))
         (unless (eq ivy-exit 'done)
@@ -1506,6 +1503,7 @@ When not running `swiper-isearch' already, start it."
       (unless (or res swiper-stay-on-quit)
         (goto-char swiper--opoint))
+      (isearch-clean-overlays)
       (unless (or res (string= ivy-text ""))
         (cl-pushnew ivy-text swiper-history)))))

reply via email to

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