]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy--recompute-index): Update cl-position logic
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 15 Jan 2016 15:37:23 +0000 (16:37 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 15 Jan 2016 15:37:23 +0000 (16:37 +0100)
Re #207

ivy.el

diff --git a/ivy.el b/ivy.el
index 553f1a54d3763cfbd3b3f0671e53072dda600947..f48459f32ed49b7b0754d5311fd8ea96532c3e47 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1964,10 +1964,10 @@ Prefix matches to NAME are put ahead of the list."
     (unless (eq this-command 'ivy-resume)
       (setq ivy--index
             (or
-             (cl-position (if (and (> (length re-str) 0)
-                                   (eq ?^ (aref re-str 0)))
-                              (substring re-str 1)
-                            re-str) cands
+             (cl-position (if (and (> (length name) 0)
+                                   (eq ?^ (aref name 0)))
+                              (substring name 1)
+                            name) cands
                             :test #'equal)
              (and ivy--directory
                   (cl-position