[Top][All Lists]

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

[elpa] master bb65c4e 039/184: swiper.el (swiper--current-window-start):

From: Oleh Krehel
Subject: [elpa] master bb65c4e 039/184: swiper.el (swiper--current-window-start): Refactor
Date: Wed, 16 Oct 2019 13:14:45 -0400 (EDT)

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

    swiper.el (swiper--current-window-start): Refactor
    Is now set to value and read only in one place. Set to nil in two other 
 swiper.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/swiper.el b/swiper.el
index 0ba5adc..c099f0c 100644
--- a/swiper.el
+++ b/swiper.el
@@ -668,7 +668,6 @@ When capture groups are present in the input, print them 
instead of lines."
       (unless (eq major-mode 'ivy-occur-grep-mode)
         (font-lock-mode -1))
-      (setq swiper--current-window-start nil)
       (insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n"
       (insert (format "%d candidates:\n" (length cands)))
@@ -794,6 +793,7 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
         (goto-char swiper--opoint))
       (unless (or res (string= ivy-text ""))
         (cl-pushnew ivy-text swiper-history))
+      (setq swiper--current-window-start nil)
       (when swiper--reveal-mode
         (reveal-mode 1)))))
@@ -932,12 +932,7 @@ the face, window and priority of the overlay."
                     (setq swiper--current-match-start (match-beginning 0))))
                 (isearch-range-invisible (line-beginning-position)
-                (when (and (swiper--recenter-p)
-                           (or
-                            (< (point) (window-start))
-                            (> (point) (window-end (ivy-state-window ivy-last) 
-                  (recenter))
-                (setq swiper--current-window-start (window-start))))
+                (swiper--maybe-recenter)))

reply via email to

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