branch: master
commit 9b9885da6eb3d260d36c1792313cb0dd053e995d
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-partial-or-done): Fixup
* ivy.el (ivy-partial-or-done): Switch `default-directory' so that
`minibuffer-complete' is aware of it. Select a directory only if there
is only one.
---
ivy.el | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ivy.el b/ivy.el
index 551ed01..feed8c3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -294,10 +294,11 @@ When called twice in a row, exit the minibuffer with the
current
candidate."
(interactive)
(if (eq (ivy-state-collection ivy-last) 'read-file-name-internal)
- (progn
+ (let ((default-directory ivy--directory))
(minibuffer-complete)
(setq ivy-text (ivy--input))
- (when (file-directory-p ivy-text)
+ (when (and (file-directory-p ivy-text)
+ (= ivy--length 1))
(ivy--cd (expand-file-name ivy-text))))
(or (ivy-partial)
(if (eq this-command last-command)