emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master be989fe 60/63: Preselect perfect matches with a leading ^


From: Oleh Krehel
Subject: [elpa] master be989fe 60/63: Preselect perfect matches with a leading ^
Date: Fri, 21 Aug 2015 12:08:49 +0000

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

    Preselect perfect matches with a leading ^
    
    * ivy.el (ivy--filter): When e.g. "filter" is in the collection,
      "^filter" input should always select it, even if other candidates
      match.
---
 ivy.el |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index faa469b..21197c3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1415,8 +1415,11 @@ CANDIDATES are assumed to be static."
       (unless (and (not (equal re ivy--old-re))
                    (or (setq ivy--index
                              (or
-                              (cl-position re cands
-                                           :test #'equal)
+                              (cl-position (if (and (> (length re) 0)
+                                                    (eq ?^ (aref re 0)))
+                                               (substring re 1)
+                                             re) cands
+                                             :test #'equal)
                               (and ivy--directory
                                    (cl-position
                                     (concat re "/") cands



reply via email to

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