]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix directory validity check
authorStephen Whipple <shw@wicdmedia.org>
Thu, 5 Nov 2015 14:07:59 +0000 (07:07 -0700)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 5 Nov 2015 15:30:48 +0000 (16:30 +0100)
Directory validity check should be based on `ivy-text` and
`ivy--directory` rather than only `ivy-text`.

Fixes #283
Fixes #284

ivy.el

diff --git a/ivy.el b/ivy.el
index 5aa109d8d60d50907afa56ae022611653e4663e3..3e1cd31c61b67ff28bab4997fa2adf04c2549d6c 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -393,9 +393,9 @@ When ARG is t, exit with current text, ignoring the candidates."
                  (and
                   (not (equal ivy-text ""))
                   (ignore-errors
-                    (file-directory-p ivy-text))
-                  (setq dir (expand-file-name
-                             ivy-text ivy--directory)))
+                    (file-directory-p
+                     (setq dir (expand-file-name
+                                ivy-text ivy--directory)))))
                  (and
                   (not (string= ivy--current "./"))
                   (cl-plusp ivy--length)