[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6dd560c 05/19: swiper.el (swiper-map): Bind "C-l" to recen
From: |
Oleh Krehel |
Subject: |
[elpa] master 6dd560c 05/19: swiper.el (swiper-map): Bind "C-l" to recenter |
Date: |
Thu, 16 Apr 2015 12:18:09 +0000 |
branch: master
commit 6dd560cd2f79bbaad2e0bb757e195f2c32d2cce7
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper-map): Bind "C-l" to recenter
* swiper.el (swiper-map): Update.
(swiper-recenter-top-bottom): New defun.
(swiper--update-input-ivy): Use `<=' in order for `recenter-top-bottom'
to work.
---
swiper.el | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/swiper.el b/swiper.el
index ffb0f4a..7a418c9 100644
--- a/swiper.el
+++ b/swiper.el
@@ -75,6 +75,7 @@
(defvar swiper-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "M-q") 'swiper-query-replace)
+ (define-key map (kbd "C-l") 'swiper-recenter-top-bottom)
map)
"Keymap for swiper.")
@@ -94,6 +95,12 @@
(swiper--cleanup)
(exit-minibuffer))))
+(defun swiper-recenter-top-bottom (&optional arg)
+ "Call (`recenter-top-bottom' ARG) in `swiper--window'."
+ (interactive "P")
+ (with-selected-window swiper--window
+ (recenter-top-bottom arg)))
+
(defvar swiper--window nil
"Store the current window.")
@@ -222,8 +229,8 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(forward-line (1- num))
(isearch-range-invisible (line-beginning-position)
(line-end-position))
- (unless (and (> (point) (window-start))
- (< (point) (window-end swiper--window t)))
+ (unless (and (>= (point) (window-start))
+ (<= (point) (window-end swiper--window t)))
(recenter)))
(let ((ov (make-overlay
(line-beginning-position)
- [elpa] master updated (cf04c93 -> 22139ae), Oleh Krehel, 2015/04/16
- [elpa] master 0d619ea 10/19: counsel.el (couns-clj): Add with-no-warnings, Oleh Krehel, 2015/04/16
- [elpa] master 6dd560c 05/19: swiper.el (swiper-map): Bind "C-l" to recenter,
Oleh Krehel <=
- [elpa] master 49321c0 06/19: Allow duplicate candidates in `ivy-read', Oleh Krehel, 2015/04/16
- [elpa] master f72a860 11/19: counsel.el: Fixup prefixes, Oleh Krehel, 2015/04/16
- [elpa] master 841d59b 01/19: "C-s" should forward to "C-n" etc, Oleh Krehel, 2015/04/16
- [elpa] master 609577e 12/19: Fix invalid package header line, Oleh Krehel, 2015/04/16
- [elpa] master e816884 03/19: Default ARG to 1 for arrows, Oleh Krehel, 2015/04/16
- [elpa] master a8a1f65 02/19: Add numeric arguments to arrows, Oleh Krehel, 2015/04/16
- [elpa] master 0477214 08/19: Fix `ivy-backward-delete-char-function', Oleh Krehel, 2015/04/16
- [elpa] master 6dd1068 04/19: swiper.el (swiper-query-replace): Enable recursive minibuffers, Oleh Krehel, 2015/04/16
- [elpa] master 3b78e0e 18/19: swiper.el: Bump version, Oleh Krehel, 2015/04/16
- [elpa] master 22139ae 19/19: Merge commit '3b78e0e503f4763f8a2d77eeacfc91213ec5532e' from swiper, Oleh Krehel, 2015/04/16