Repository navigation
ivy.el (ivy--prompt-selectable-p): Fix require-match condition - #1063
Merged
abo-abo merged 1 commit intoJun 9, 2017
Merged
Conversation
The prompt was not selectable, if predicate :require-match was set to 'confirm or 'confirm-after-completion.
Owner
|
Thanks. |
basil-conto
added a commit
to basil-conto/swiper
that referenced
this pull request
Aug 30, 2026
A require-match function was called without arguments, and when it indicated success the prompt had "(confirm)" appended. At the same time, confirm and confirm-after-completion were ignored. * ivy.el (ivy--prompt-extra): Switch to holding a well-known symbol value in place of a string. All uses updated. (ivy--prompt-extras, ivy-confirm-exit-commands): New variables. (ivy--old-cands): Clarify docstring. (ivy--expand-file-name): Don't use beginning-of-line anchor for matching beginning-of-string. (ivy--use-selectable-prompt, ivy--prompt-selectable-p): Remove; use ivy-use-selectable-prompt directly instead. This makes the prompt selectable even in the presence of require-match (abo-abo#1059, abo-abo#1063, abo-abo#1924, abo-abo#2364, abo-abo#3059). (ivy--prompt-selected-p, ivy-next-line, ivy-previous-line) (ivy--reset-state): Simplify accordingly. (ivy-done): Exit early when input is empty and there are no matching candidates, regardless of require-match (abo-abo#909). If require-match is a function, call it early, with the input as argument, and display "(match required)" on failure, not "(confirm)" on success (abo-abo#3081, abo-abo#3082, abo-abo#3083). Display "(confirm)" for the appropriate require-match values of confirm and confirm-after-completion, using ivy-confirm-exit-commands in addition to minibuffer-confirm-exit-commands. Don't force confirm-nonexistent-file-or-buffer handling on all read-file-name-internal and internal-complete-buffer completion (abo-abo#60, abo-abo#76). Simplify ivy-dispatching-done condition (abo-abo#2365). (ivy-tab-space): Mention ivy-partial in docstring. (ivy-call): Allow require-match functions to reject ivy-state-current in, e.g., noninteractive test sessions. (ivy-read, ivy-completing-read) (ivy-completing-read-with-empty-string-def): Improve docstrings. (ivy-set-prompt-text-properties-default): Refactor in terms of ivy--prompt-extras. (ivy--insert-prompt): Translate ivy--prompt-extra symbols into their print representation. (ivy-switch-buffer, ivy-switch-buffer-other-window): * counsel.el (counsel--find-file-1, counsel-fzf, counsel-file-jump): Consistently use function confirm-nonexistent-file-or-buffer (abo-abo#60). (counsel-dired-jump): Require a match; otherwise the action fails. * ivy-test.el (ivy-test-with): Wrap definition in eval-and-compile to work around Emacs 25 macroexpansion bug. (ivy-test-read-matching): New convenience function. (ivy-completing-read-can-match, ivy-completing-read-must-match) (ivy-completing-read-confirm, ivy-completing-read-confirm-after) (ivy-completing-read-must-match-fn): New tests. (ivy-read-file-name-initial-input): Simplify :require-match. (ivy-use-selectable-prompt-mustmatch): Rename... (ivy-use-selectable-prompt-must-match): ...to this. Extend tests. * doc/ivy.org (Faces): Generalize description of ivy-confirm-face and ivy-match-required-face. * doc/ivy.texi: Regenerate manual. Fixes abo-abo#3059. Fixes abo-abo#3081. Fixes abo-abo#3082. Closes abo-abo#3083.
basil-conto
added a commit
to basil-conto/swiper
that referenced
this pull request
Sep 13, 2026
A require-match function was called without arguments, and when it indicated success the prompt had "(confirm)" appended. At the same time, confirm and confirm-after-completion were ignored. * ivy.el (ivy--prompt-extra): Switch to holding a well-known symbol value in place of a string. All uses updated. (ivy--prompt-extras, ivy-confirm-exit-commands): New variables. (ivy--old-cands): Clarify docstring. (ivy--expand-file-name): Don't use beginning-of-line anchor for matching beginning-of-string. (ivy--use-selectable-prompt, ivy--prompt-selectable-p): Remove; use ivy-use-selectable-prompt directly instead. This makes the prompt selectable even in the presence of require-match (abo-abo#1059, abo-abo#1063, abo-abo#1924, abo-abo#2364, abo-abo#3059). (ivy--prompt-selected-p, ivy-next-line, ivy-previous-line) (ivy--reset-state): Simplify accordingly. (ivy-done): Exit early when input is empty and there are no matching candidates, regardless of require-match (abo-abo#909). If require-match is a function, call it early, with the input as argument, and display "(match required)" on failure, not "(confirm)" on success (abo-abo#3081, abo-abo#3082, abo-abo#3083). Display "(confirm)" for the appropriate require-match values of confirm and confirm-after-completion, using ivy-confirm-exit-commands in addition to minibuffer-confirm-exit-commands. Don't force confirm-nonexistent-file-or-buffer handling on all read-file-name-internal and internal-complete-buffer completion (abo-abo#60, abo-abo#76). Simplify ivy-dispatching-done condition (abo-abo#2365). (ivy-tab-space): Mention ivy-partial in docstring. (ivy-call): Allow require-match functions to reject ivy-state-current in, e.g., noninteractive test sessions. (ivy-read, ivy-completing-read) (ivy-completing-read-with-empty-string-def): Improve docstrings. (ivy-set-prompt-text-properties-default): Refactor in terms of ivy--prompt-extras. (ivy--insert-prompt): Translate ivy--prompt-extra symbols into their print representation. (ivy-switch-buffer, ivy-switch-buffer-other-window): * counsel.el (counsel--find-file-1, counsel-fzf, counsel-file-jump): Consistently use function confirm-nonexistent-file-or-buffer (abo-abo#60). (counsel-dired-jump): Require a match; otherwise the action fails. * ivy-test.el (ivy-test-with): Wrap definition in eval-and-compile to work around Emacs 25 macroexpansion bug. (ivy-test-read-matching): New convenience function. (ivy-completing-read-can-match, ivy-completing-read-must-match) (ivy-completing-read-confirm, ivy-completing-read-confirm-after) (ivy-completing-read-must-match-fn): New tests. (ivy-read-file-name-initial-input): Simplify :require-match. (ivy-use-selectable-prompt-mustmatch): Rename... (ivy-use-selectable-prompt-must-match): ...to this. Extend tests. * doc/ivy.org (Faces): Generalize description of ivy-confirm-face and ivy-match-required-face. * doc/ivy.texi: Regenerate manual. Fixes abo-abo#3059. Fixes abo-abo#3081. Fixes abo-abo#3082. Closes abo-abo#3083.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The prompt was not selectable, if predicate
:require-matchwas set to'confirmor'confirm-after-completion.