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.el: Make prompt line selectable #1059

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@fabacino
Contributor

fabacino commented Jun 8, 2017

This is an attempt to make selecting a custom input more intuitive by letting the user select the prompt line, as suggested by @Stebalien in #933 (comment).

Calling ivy-done (C-m) or ivy-alt-done (C-j) on a selected prompt exits with the current user input and is thus equivalent to calling ivy-immediate-done (C-M-j) when any candidate is selected. Therefore, remembering C-M-j is not necessary anymore. If no candidate matches the current input, the prompt line is selected automatically, as this is the only option left for the user.

To activate this behaviour, set the new variable ivy-use-selectable-prompt to t. Note that selecting the prompt line is not possible if ivy-read is called with predicate :require-match set to t, since a custom input is not allowed in this case. Customize face ivy-prompt-match to adjust the look of the selected prompt if you want it to differ from a selected candidate.

fabacino added some commits Jun 7, 2017

ivy.el: Make prompt line selectable
Calling `ivy-done` or `ivy-alt-done` on a selected prompt forwards to
`ivy-immediate-done`, thus exiting with the current user input instead
of the selected candidate.

@abo-abo abo-abo closed this in 6b004d2 Jun 9, 2017

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Jun 9, 2017

Thanks. But it still doesn't work for counsel-find-file, which is the most common case. Maybe remove or update the :require-match check?

@fabacino

This comment has been minimized.

Contributor

fabacino commented Jun 9, 2017

Thanks for your response, I made a follow-up PR #1063 which should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment