branch: master commit b4af1a6d728e79e17be185b211fe4c127f3d8274 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
swiper.el (swiper-recenter-top-bottom): Works for swiper-isearch --- swiper.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/swiper.el b/swiper.el index c099f0c..f2645aa 100644 --- a/swiper.el +++ b/swiper.el @@ -370,11 +370,17 @@ Make sure `swiper-mc' is on `mc/cmds-to-run-once' list." (mc/create-fake-cursor-at-point)))) (multiple-cursors-mode 1)))))) +(defvar swiper--current-window-start nil + "Store `window-start' to restore it later. +This prevents a \"jumping\" behavior which occurs when variables +such as `scroll-conservatively' are set to a high value.") + (defun swiper-recenter-top-bottom (&optional arg) "Call (`recenter-top-bottom' ARG)." (interactive "P") (with-ivy-window - (recenter-top-bottom arg))) + (recenter-top-bottom arg) + (setq swiper--current-window-start (window-start)))) (defvar swiper-font-lock-exclude '(Man-mode @@ -571,11 +577,6 @@ When non-nil, INITIAL-INPUT is the initial search pattern." (deactivate-mark)) (swiper-all thing))) -(defvar swiper--current-window-start nil - "Store `window-start' to restore it later. -This prevents a \"jumping\" behavior which occurs when variables -such as `scroll-conservatively' are set to a high value.") - (defun swiper--extract-matches (regex cands) "Extract captured REGEX groups from CANDS." (let (res)