[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2191bdb 54/67: ivy.el (ivy-completions): Simplify
From: |
Oleh Krehel |
Subject: |
[elpa] master 2191bdb 54/67: ivy.el (ivy-completions): Simplify |
Date: |
Sun, 22 Mar 2015 17:34:09 +0000 |
branch: master
commit 2191bdb41a0cc0f45c1f2710208d73b82e9e386e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-completions): Simplify
---
ivy.el | 19 ++++++-------------
1 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/ivy.el b/ivy.el
index 25d8a70..34f7ad8 100644
--- a/ivy.el
+++ b/ivy.el
@@ -362,19 +362,12 @@ CANDIDATES is a list of strings."
(setq ivy--index (max (1- ivy--length) 0)))
(if (null cands)
""
- (let ((index ivy--index))
- (if (< index (/ ivy-height 2))
- (setq cands
- (cl-subseq cands 0 (min (1- ivy-height) ivy--length)))
- (setq cands
- (cl-subseq cands
- (- index (/ ivy-height 2))
- (min (+ index (/ ivy-height 2))
- ivy--length)))
- (setq index (min (/ ivy-height 2)
- (1- (length cands)))))
- (setq ivy--current (copy-sequence
- (nth index cands)))
+ (let* ((half-height (/ ivy-height 2))
+ (start (max 0 (- ivy--index half-height)))
+ (end (min (+ start (1- ivy-height)) ivy--length))
+ (cands (cl-subseq cands start end))
+ (index (min ivy--index half-height (1- (length cands)))))
+ (setq ivy--current (copy-sequence (nth index cands)))
(setf (nth index cands)
(ivy--add-face ivy--current 'ivy-current-match))
(concat "\n" (mapconcat
- [elpa] master 7bb5320 42/67: swiper.el (swiper--helm): Require helm-match-plugin, (continued)
- [elpa] master 7bb5320 42/67: swiper.el (swiper--helm): Require helm-match-plugin, Oleh Krehel, 2015/03/22
- [elpa] master caa69f2 43/67: counsel.el: Add git file completion, Oleh Krehel, 2015/03/22
- [elpa] master fcb18e5 44/67: ivy.el (ivy-read): Bring last history candidate to front, Oleh Krehel, 2015/03/22
- [elpa] master e32bc63 46/67: swiper.el: Fix non-matching lines issue with initial-input, Oleh Krehel, 2015/03/22
- [elpa] master f1672c7 45/67: Add isearch-like history behavior, Oleh Krehel, 2015/03/22
- [elpa] master 41732be 48/67: ivy.el: Return nil when there is no match, Oleh Krehel, 2015/03/22
- [elpa] master 588dab6 49/67: ivy-test.el: Add testing, Oleh Krehel, 2015/03/22
- [elpa] master f754835 47/67: swiper.el: Silence a few compilation warnings, Oleh Krehel, 2015/03/22
- [elpa] master cc4bf75 52/67: README.md: Add build status, Oleh Krehel, 2015/03/22
- [elpa] master 2b8e4e1 53/67: ivy.el: Remove while-no-input, Oleh Krehel, 2015/03/22
- [elpa] master 2191bdb 54/67: ivy.el (ivy-completions): Simplify,
Oleh Krehel <=
- [elpa] master d587fa2 51/67: ivy.el (ivy-read): Allow for format-style PROMPT, Oleh Krehel, 2015/03/22
- [elpa] master 9f9c4dc 57/67: swiper-helm.el: Fix typo, Oleh Krehel, 2015/03/22
- [elpa] master 3a08a88 50/67: ivy.el (ivy-read): Change index to preselect, Oleh Krehel, 2015/03/22
- [elpa] master d2b2813 55/67: swiper-helm.el: Copy all helm stuff here, Oleh Krehel, 2015/03/22
- [elpa] master c4acef9 56/67: swiper.el: Remove the helm bits, Oleh Krehel, 2015/03/22
- [elpa] master 0c85d9a 58/67: Add a custom `ivy-count-format', Oleh Krehel, 2015/03/22
- [elpa] master c2e58e9 59/67: Fix invalid package header line, Oleh Krehel, 2015/03/22
- [elpa] master a275a2a 60/67: Use `font-lock-append-text-property' to non-destructively modify a, Oleh Krehel, 2015/03/22
- [elpa] master 7876619 61/67: Update "C-n" and "C-p" bindings, Oleh Krehel, 2015/03/22
- [elpa] master f20b287 62/67: swiper.el (swiper--init): Set `swiper--opoint', Oleh Krehel, 2015/03/22