New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ivy-use-selectable-prompt doesn't work when a dynamic collection is empty #1183
Comments
Could reproduce the issue with (ivy-read "choose: "
'(lambda (x)
(if (> (length x) 2)
'()
'("a" "b" "c")))
:dynamic-collection t) I will take a look at it. |
Previously, the minibuffer prompt was not refreshed in case a dynamic collection returned no candidates. This triggered the following problems: - Candidates were displayed even though they did not match the filter. - The prompt was not selectable. Fixes abo-abo#1183
@fabacino Sorry, I have to revert your commit: it breaks the smooth redisplay for |
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 abo-abo#1183
@abo-abo Thanks for your feedback. I think the problem is that a value of
I made a new fix, basically checking if there is a running counsel process. If there is, an async function is still running and we don't refresh the minibuffer. If there is none, however, we can safely assume that the function has returned an empty set of candidates. In that case, we update the minibuffer. If you like it, I can PR. The hard-coded process name is not pretty, but there are other references to the counsel package within |
Sounds good, please PR. We can refactor the hard-coded stuff later if there's a need. |
When a dynamic collection is empty, one can't select the input field by enabling
ivy-use-selectable-prompt
.Also, pressing RET calls the action on the last highlighted item (the item that was being highlighted just before the dynamic collection function returned an empty collection). This is probably related so I figured I'd note it.
The text was updated successfully, but these errors were encountered: