Do not filter completion candidates by completion target#912
Open
tompng wants to merge 2 commits into
Open
Conversation
Aligns tab completion with GNU Readline and readline-ext: candidates returned by completion_proc are used as-is, and filtering them is completion_proc's responsibility. completion_case_fold now only affects the common prefix computation. When the candidates have no common prefix, TAB leaves the line unchanged but still displays the candidate list on the next TAB, matching GNU Readline. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the repeated completion_proc boilerplate (prefix filtering and test-encoding conversion) in key actor tests. Tests exercising special procs (nil-containing, intentionally unfiltered, word-dependent) keep assigning completion_proc directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Aligns tab completion with GNU Readline / readline-ext: candidates returned by
completion_procare used as-is, and filtering them iscompletion_proc's responsibility.completion_case_foldnow only affects the common prefix computation.Verified against readline-ext linked with GNU Readline 8.3 (libedit behaves the same):
ABCX abcy+ inputz+ case_fold →ABC), andcompletion_case_foldonly changes how this common prefix is computed.Since Reline no longer filters,
completion_proc— for both tab completion and the autocomplete dialog — has full control over how candidates are narrowed down: prefix, case-insensitive, fuzzy, or no filtering at all. This works as an alternative to #883: its fuzzy matching example can now be implemented insidecompletion_procwithout adding a new API.Note for
completion_procimplementors: procs that returned unfiltered candidates and relied on Reline's filtering will now show all of them — the same behavior as when they are used with Readline. irb and pry already filter candidates by themselves.