branch: master
commit b99f6de7b5b435280db67b812a76d2363ec8305d
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy--directory-done): Fix when ivy-text exists
Fixes #792
---
ivy.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index 8a916f9..524d96f 100644
--- a/ivy.el
+++ b/ivy.el
@@ -643,7 +643,10 @@ When ARG is t, exit with current text, ignoring the
candidates."
(ivy--exhibit))
((and (not (string= ivy-text ""))
(file-exists-p ivy-text))
- (ivy--cd (file-name-as-directory ivy-text)))
+ (if (file-directory-p ivy-text)
+ (ivy--cd (expand-file-name
+ (file-name-as-directory ivy-text) ivy--directory))
+ (ivy-done)))
((or (and (equal ivy--directory "/")
(string-match "\\`[^/]+:.*:.*\\'" ivy-text))
(string-match "\\`/[^/]+:.*:.*\\'" ivy-text))