branch: externals/ivy-hydra
commit 41bd9886a5206d24f31cc3c4e33f5c5d72bff408
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-alt-done): In an empty directory with no input return this
directory
Fixes #2368
---
ivy.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ivy.el b/ivy.el
index 6ad7d8e..1748de3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1035,6 +1035,12 @@ contains a single candidate.")
"Handle exit from the minibuffer when completing file names."
(let ((dir (ivy--handle-directory ivy-text)))
(cond
+ ((equal (ivy-state-current ivy-last) (ivy-state-def ivy-last))
+ (ivy-done))
+ ((and (ivy-state-require-match ivy-last)
+ (equal ivy-text "")
+ (null ivy--old-cands))
+ (ivy-immediate-done))
(dir
(let ((inhibit-message t))
(ivy--cd dir)))