[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9eb5275 227/399: ivy.el (ivy--minibuffer-index-bounds): Ex
From: |
Oleh Krehel |
Subject: |
[elpa] master 9eb5275 227/399: ivy.el (ivy--minibuffer-index-bounds): Extract |
Date: |
Sat, 20 Jul 2019 14:57:28 -0400 (EDT) |
branch: master
commit 9eb5275cd65ebc1bd7e7b2bd5fcc8fb631576db0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--minibuffer-index-bounds): Extract
---
ivy.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 2b9b139..658cc50 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3595,6 +3595,14 @@ Note: The usual last two arguments are flipped for
convenience.")
(propertize str 'face 'ivy-subdir)
str))
+(defun ivy--minibuffer-index-bounds ()
+ (let* ((half-height (/ ivy-height 2))
+ (start (max 0 (- ivy--index half-height)))
+ (end (min (+ start (1- ivy-height)) ivy--length))
+ (start (max 0 (min start (- end (1- ivy-height))))))
+ (setq ivy--window-index (- ivy--index start))
+ (cons start end)))
+
(defun ivy--format (cands)
"Return a string for CANDS suitable for display in the minibuffer.
CANDS is a list of strings."
@@ -3604,13 +3612,9 @@ CANDS is a list of strings."
(if (null cands)
(setf (ivy-state-current ivy-last) "")
(setf (ivy-state-current ivy-last) (copy-sequence (nth ivy--index cands)))
- (let* ((half-height (/ ivy-height 2))
- (start (max 0 (- ivy--index half-height)))
- (end (min (+ start (1- ivy-height)) ivy--length))
- (start (max 0 (min start (- end (1- ivy-height)))))
- (wnd-cands (cl-subseq cands start end))
+ (let* ((bnd (ivy--minibuffer-index-bounds))
+ (wnd-cands (cl-subseq cands (car bnd) (cdr bnd)))
transformer-fn)
- (setq ivy--window-index (- ivy--index start))
(when (setq transformer-fn (ivy-state-display-transformer-fn ivy-last))
(with-ivy-window
(with-current-buffer (ivy-state-buffer ivy-last)
- [elpa] master 3f27e25 207/399: counsel.el (counsel-compile): Don't squash default-directory, (continued)
- [elpa] master 3f27e25 207/399: counsel.el (counsel-compile): Don't squash default-directory, Oleh Krehel, 2019/07/20
- [elpa] master 6de6233 205/399: counsel.el (counsel-compile): New counsel-compile-env helper, Oleh Krehel, 2019/07/20
- [elpa] master f628eb3 210/399: swiper.el (swiper-isearch-symbol-at-point): Add, Oleh Krehel, 2019/07/20
- [elpa] master bed783e 217/399: ivy-test.el (swiper-isearch-case-fold): Add test, Oleh Krehel, 2019/07/20
- [elpa] master 4147453 212/399: swiper.el (swiper-isearch-thing-at-point): Add, Oleh Krehel, 2019/07/20
- [elpa] master 9a2b110 214/399: ivy.el (ivy-insert-current): Insert text without properties, Oleh Krehel, 2019/07/20
- [elpa] master f1b3fa4 209/399: swiper.el (swiper-isearch): Support swiper-goto-start-of-match, Oleh Krehel, 2019/07/20
- [elpa] master bd958e7 208/399: counsel.el (counsel-org-files): Re-use org-attach-dir, Oleh Krehel, 2019/07/20
- [elpa] master 9c1e1c3 216/399: swiper.el (swiper-isearch-function): Obey ivy-case-fold-search-default, Oleh Krehel, 2019/07/20
- [elpa] master 6f56049 230/399: ivy.el (ivy--minibuffer-index-bounds): Make pure, Oleh Krehel, 2019/07/20
- [elpa] master 9eb5275 227/399: ivy.el (ivy--minibuffer-index-bounds): Extract,
Oleh Krehel <=
- [elpa] master f292ed3 226/399: ivy.el (ivy-help): Reveal all Org contents, Oleh Krehel, 2019/07/20
- [elpa] master 3a16cec 223/399: ivy.el (ivy-occur): Don't setq-local ivy--directory, Oleh Krehel, 2019/07/20
- [elpa] master 9e513d0 211/399: swiper.el (swiper-thing-at-point): Add, Oleh Krehel, 2019/07/20
- [elpa] master ecff164 215/399: ivy.el (ivy-insert-current): Minor simplification, Oleh Krehel, 2019/07/20
- [elpa] master 8a8aea2 219/399: counsel.el (counsel-company): Use company-prefix, Oleh Krehel, 2019/07/20
- [elpa] master fa9acdb 222/399: swiper.el (swiper-isearch-thing-at-point): Add symbol boundaries, Oleh Krehel, 2019/07/20
- [elpa] master 6768214 221/399: ivy.el (ivy--insert-symbol-boundaries): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 2e4f2fb 213/399: Fix grep-occur when using multi-pass re-builders, Oleh Krehel, 2019/07/20
- [elpa] master a9e81f8 220/399: ivy.el: Don't offer virtual buffers for plain switch-to-buffer, Oleh Krehel, 2019/07/20
- [elpa] master 5eea0af 229/399: ivy.el (ivy--minibuffer-index-bounds): Simplify logic, Oleh Krehel, 2019/07/20