branch: master
commit b7f27003f0afd15e7013a52811da4be8b76713d1
Author: fabacino <[email protected]>
Commit: fabacino <[email protected]>
ivy.el (ivy--exhibit): Update prompt even if there are no candidates
Previously, the minibuffer prompt was not refreshed in case a dynamic
collection returned no candidates.
For async commands this makes sense as `nil` could be interpreted both
as the empty list, meaning no candidates found, or as a sign that the
process is still running.
For sync functions however, it is clear that `nil` stands for no
candidates found and thus the minibuffer should be refreshed. This
should fix the following problems:
- Candidates were displayed even though they did not match the filter.
- The prompt was not selectable.
Fixes #1183
---
ivy.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index 5e147d9..4eb3a94 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2595,7 +2595,8 @@ Should be run via minibuffer `post-command-hook'."
(ivy--sort-maybe
(funcall (ivy-state-collection ivy-last) ivy-text)))
(setq ivy--old-text ivy-text)))
- (when ivy--all-candidates
+ (when (or ivy--all-candidates
+ (not (get-process " *counsel*")))
(ivy--insert-minibuffer
(ivy--format ivy--all-candidates))))
(cond (ivy--directory