[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master dd3e1c9 038/184: swiper.el (swiper--maybe-recenter): Refac
From: |
Oleh Krehel |
Subject: |
[elpa] master dd3e1c9 038/184: swiper.el (swiper--maybe-recenter): Refactor |
Date: |
Wed, 16 Oct 2019 13:14:44 -0400 (EDT) |
branch: master
commit dd3e1c9ea68db178e0a09254d4e8bd2d94115699
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--maybe-recenter): Refactor
---
swiper.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/swiper.el b/swiper.el
index b2c884b..0ba5adc 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1036,9 +1036,14 @@ WND, when specified is the window."
(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))))
+ ((swiper--recenter-p)
+ (when swiper--current-window-start
+ (set-window-start (selected-window) swiper--current-window-start))
+ (when (or
+ (< (point) (window-start))
+ (> (point) (window-end (ivy-state-window ivy-last) t)))
+ (recenter))))
+ (setq swiper--current-window-start (window-start)))
(defun swiper--action (x)
"Goto line X."
@@ -1408,7 +1413,7 @@ 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)))
@@ -1416,18 +1421,12 @@ that we search only for one character."
(goto-char (match-beginning 0)))
(isearch-range-invisible (point) (1+ (point)))
(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 35415e3 027/184: ivy-test.el (ivy-swiper-wgrep): Add test, (continued)
- [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, 2019/10/16
- [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 <=
- [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
- [elpa] master 17d9c70 036/184: counsel.el (counsel--find-return-list): Re-use counsel--call, Oleh Krehel, 2019/10/16
- [elpa] master 44c4bab 057/184: Restore use-ignore setting on ivy-resume, Oleh Krehel, 2019/10/16
- [elpa] master d3e4514 063/184: Remove obsolete aliases older than one year, Oleh Krehel, 2019/10/16
- [elpa] master 0be5b58 067/184: ivy.el (ivy-partial): Don't rely on subr-x, Oleh Krehel, 2019/10/16
- [elpa] master a986e4e 071/184: ivy.el (ivy--yank-handle-case-fold): Add, Oleh Krehel, 2019/10/16
- [elpa] master e41cbec 073/184: ivy.el (ivy-immediate-done): Fix parent dirs for read-directory-name, Oleh Krehel, 2019/10/16
- [elpa] master 3256447 076/184: ivy.el (ivy--partial-cd-for-single-directory): Extract, Oleh Krehel, 2019/10/16
- [elpa] master 03b3f82 075/184: ivy.el (ivy-partial): Use ivy--filter in place of all-completions, Oleh Krehel, 2019/10/16