[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ae3576a 037/184: swiper.el (swiper-isearch): Fix scroll on
From: |
Oleh Krehel |
Subject: |
[elpa] master ae3576a 037/184: swiper.el (swiper-isearch): Fix scroll on RET |
Date: |
Wed, 16 Oct 2019 13:14:44 -0400 (EDT) |
branch: master
commit ae3576a9a99219bc03334d2a4574251b491ce339
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper-isearch): Fix scroll on RET
Re #2159
---
swiper.el | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/swiper.el b/swiper.el
index ff1e88c..b2c884b 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1033,6 +1033,12 @@ WND, when specified is the window."
(defvar evil-ex-search-direction)
(declare-function evil-ex-search-activate-highlight "evil-ex")
+(defun swiper--maybe-recenter ()
+ (cond (swiper-action-recenter
+ (recenter))
+ ((and swiper--current-window-start
+ (swiper--recenter-p))
+ (set-window-start (selected-window) swiper--current-window-start))))
(defun swiper--action (x)
"Goto line X."
@@ -1055,11 +1061,7 @@ WND, when specified is the window."
(when (and (re-search-forward re (line-end-position) t)
swiper-goto-start-of-match)
(goto-char (match-beginning 0)))
(swiper--ensure-visible)
- (cond (swiper-action-recenter
- (recenter))
- ((and swiper--current-window-start
- (swiper--recenter-p))
- (set-window-start (selected-window)
swiper--current-window-start)))
+ (swiper--maybe-recenter)
(when (/= (point) swiper--opoint)
(unless (and transient-mark-mode mark-active)
(when (eq ivy-exit 'done)
@@ -1406,21 +1408,26 @@ that we search only for one character."
(and (> (length x) 0)
(setq x (get-text-property 0 'point x))))
(with-ivy-window
- (goto-char x)
+ (goto-char x)
(when (and (or (eq this-command 'ivy-previous-line-or-history)
(and (eq this-command 'ivy-done)
(eq last-command 'ivy-previous-line-or-history)))
(looking-back ivy--old-re (line-beginning-position)))
(goto-char (match-beginning 0)))
(isearch-range-invisible (point) (1+ (point)))
- (when swiper-action-recenter
+ (swiper--maybe-recenter)
+ (when (and (swiper--recenter-p)
+ (or
+ (< (point) (window-start))
+ (> (point) (window-end (ivy-state-window ivy-last) t))))
(recenter))
+ (setq swiper--current-window-start (window-start))
(unless (eq ivy-exit 'done)
(swiper--cleanup)
(swiper--delayed-add-overlays)
(swiper--add-cursor-overlay
(ivy-state-window ivy-last))))
- (swiper--cleanup)))
+ (swiper--cleanup)))
(defun swiper-isearch-thing-at-point ()
"Insert `symbol-at-point' into the minibuffer of `swiper-isearch'.
- [elpa] master 582c9d4 014/184: swiper.el (swiper--candidates): Don't store line number as a string, (continued)
- [elpa] master 582c9d4 014/184: swiper.el (swiper--candidates): Don't store line number as a string, Oleh Krehel, 2019/10/16
- [elpa] master 4a44c9e 018/184: counsel.el (counsel--async-last-error-string): Add for ease of debugging, Oleh Krehel, 2019/10/16
- [elpa] master 5e79f16 020/184: ivy.el (ivy--input): Fix point moving in TRAMP sessions, Oleh Krehel, 2019/10/16
- [elpa] master f30c6e1 022/184: swiper.el: Fix overlay faces using regex-ignore-order, Oleh Krehel, 2019/10/16
- [elpa] master 9c4cdb7 025/184: swiper.el (swiper-isearch-action): Fix for ivy-occur, Oleh Krehel, 2019/10/16
- [elpa] master ed1ba4e 028/184: Makefile (deps): Add target, Oleh Krehel, 2019/10/16
- [elpa] master b5e869e 026/184: swiper.el (swiper--occur-cands): Fix wgrep, Oleh Krehel, 2019/10/16
- [elpa] master 6928beb 031/184: ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Passes, Oleh Krehel, 2019/10/16
- [elpa] master 35415e3 027/184: ivy-test.el (ivy-swiper-wgrep): Add test, Oleh Krehel, 2019/10/16
- [elpa] master fb78c3f 045/184: swiper.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master ae3576a 037/184: swiper.el (swiper-isearch): Fix scroll on RET,
Oleh Krehel <=
- [elpa] master c4e0b0b 032/184: ivy-test.el (ivy-read-file-name-make-directory): Add, Oleh Krehel, 2019/10/16
- [elpa] master fdd2178 042/184: ivy.el (ivy--magic-tilde-directory): Use "~~" to move to local home, Oleh Krehel, 2019/10/16
- [elpa] master a9196a2 035/184: counsel.el (counsel-file-jump-args): Is now a list, Oleh Krehel, 2019/10/16
- [elpa] master e58231e 033/184: ivy.el (ivy-immediate-done): Fix for when "C-j" changed cwd, Oleh Krehel, 2019/10/16
- [elpa] master 0132ced 044/184: counsel.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master c4842ec 043/184: Fix typo: 'beggining', Oleh Krehel, 2019/10/16
- [elpa] master 28e9416 052/184: ivy.el (ivy--input): Fix for ediff, Oleh Krehel, 2019/10/16
- [elpa] master dd3e1c9 038/184: swiper.el (swiper--maybe-recenter): Refactor, Oleh Krehel, 2019/10/16
- [elpa] master 5ff5139 051/184: ivy.el (ivy-read-action-function): Allow to read actions using Ivy, Oleh Krehel, 2019/10/16
- [elpa] master e4e0ec4 049/184: counsel.el (counsel--file-name-filter): Return "cat" on empty input, Oleh Krehel, 2019/10/16