[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master bcb81dd 049/272: Fix swiper "backward" search

From: Oleh Krehel
Subject: [elpa] master bcb81dd 049/272: Fix swiper "backward" search
Date: Mon, 25 Apr 2016 10:13:16 +0000

branch: master
commit bcb81dde6e1abba02256d716426797a3e1b306f1
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Fix swiper "backward" search
    * ivy.el (ivy-recompute-index-swiper): When none of the previous
      candidates after the point match the current input, instead of
      returning 0, return the index of the last matching candidate.  This is
      a good choice, because that candidate is the closest to the point of
      the initial search start.
    Fixes #319
 ivy.el |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index e65635d..bb2aa99 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1998,7 +1998,9 @@ Prefix matches to NAME are put ahead of the list."
           (while (and tail (null idx))
             ;; Compare with eq to handle equal duplicates in cands
             (setq idx (cl-position (pop tail) cands)))
-          (or idx 0))
+          (or
+           idx
+           (1- (length cands))))
       (if ivy--old-cands
         ;; already in ivy-state-buffer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]