branch: externals/ivy-hydra
commit 2d4d6d690702f943b4f71e0d2a6604d1eb6ef646
Author: Matt Kramer <[email protected]>
Commit: Oleh Krehel <[email protected]>
Use text, not "current", in -dispatching-done when no matches
Helpful, for example, in counsel-find-file if you want to dispatch an
action on a file that doesn't exist.
Fixes #2364
Fixes #2365
---
ivy.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index e9de309..ede57d3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -787,7 +787,10 @@ candidate, not the prompt."
(ivy-immediate-done)
(setq ivy-current-prefix-arg current-prefix-arg)
(delete-minibuffer-contents)
- (cond ((or (> ivy--length 0)
+ (cond ((and (= ivy--length 0)
+ (eq this-command 'ivy-dispatching-done))
+ (ivy--done ivy-text))
+ ((or (> ivy--length 0)
;; the action from `ivy-dispatching-done' may not need a
;; candidate at all
(eq this-command 'ivy-dispatching-done))