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

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

[elpa] master d0f3826 11/18: ivy.el (ivy--preselect-index): Give priorit


From: Oleh Krehel
Subject: [elpa] master d0f3826 11/18: ivy.el (ivy--preselect-index): Give priority to perfect match
Date: Mon, 20 Apr 2015 12:39:05 +0000

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

    ivy.el (ivy--preselect-index): Give priority to perfect match
---
 ivy.el |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ivy.el b/ivy.el
index 50704f6..d52b4b9 100644
--- a/ivy.el
+++ b/ivy.el
@@ -445,10 +445,11 @@ Turning on Ivy mode will set `completing-read-function' to
            (lambda (x)
              (string-match initial-input x))
            candidates)))
-  (cl-position-if
-   (lambda (x)
-     (string-match preselect x))
-   candidates))
+  (or (cl-position preselect candidates :test 'equal)
+      (cl-position-if
+       (lambda (x)
+         (string-match preselect x))
+       candidates)))
 
 ;;* Implementation
 ;;** Regex



reply via email to

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