branch: master
commit dd559adcf15b6c2fb8f9ee9adb5e43721570bb94
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
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)))