]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-partial-or-done): Fixup
authorOleh Krehel <ohwoeowho@gmail.com>
Mon, 11 May 2015 14:55:18 +0000 (16:55 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 11 May 2015 14:55:18 +0000 (16:55 +0200)
* 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

diff --git a/ivy.el b/ivy.el
index 551ed01a336910d8b72090ddd5b70b33fa200e88..feed8c3b6df1e6dd9166850f6eade2e51bee28e6 100644 (file)
--- 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)