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

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

[elpa] master dd559ad 07/22: ivy.el (ivy--filter): Try directory expansi


From: Oleh Krehel
Subject: [elpa] master dd559ad 07/22: ivy.el (ivy--filter): Try directory expansion with "/"
Date: Wed, 22 Apr 2015 19:51:47 +0000

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

    ivy.el (ivy--filter): Try directory expansion with "/"
    
    * ivy.el (ivy--filter): If candidate is "x" and completing file names,
      check if "x/" is among the candidates, and if so, set `ivy--index'
      accordingly.
    
    Re #50
---
 ivy.el |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ivy.el b/ivy.el
index d878172..cd02f2a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -711,7 +711,14 @@ CANDIDATES are assumed to be static."
          idx)
     (when (and tail ivy--old-cands)
       (unless (and (not (equal re ivy--old-re))
-                   (setq ivy--index (cl-position re cands :test 'equal)))
+                   (or (setq ivy--index
+                             (or
+                              (cl-position re cands
+                                           :test 'equal)
+                              (and ivy--directory
+                                   (cl-position
+                                    (concat re "/") cands
+                                    :test 'equal))))))
         (while (and tail (null idx))
           ;; Compare with eq to handle equal duplicates in cands
           (setq idx (cl-position (pop tail) cands)))



reply via email to

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