feat(textinput): expose matched suggestions and index#556
Merged
meowgorithm merged 1 commit intocharmbracelet:masterfrom Sep 19, 2024
Merged
feat(textinput): expose matched suggestions and index#556meowgorithm merged 1 commit intocharmbracelet:masterfrom
meowgorithm merged 1 commit intocharmbracelet:masterfrom
Conversation
Member
|
Good call; I believe this makes sense. Fwiw, I think there are a lot of improvements that can happen to suggestions in general and I've been wondering if the API needs to be reexamined altogether. |
caarlos0
approved these changes
Aug 13, 2024
Member
|
This is a good one. Thanks for the contribution, @luevano. |
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.
In its current state, if I want to get the matched suggestions (and their index) I need to recalculate that myself when the bubble already does this for free (as in already available). This allows to use the matching suggestions data to display any sort of custom views.
For example, in its current state, if I want to list the suggestions I only have access to the


Availableones, and this is all I can display (without recalculating myself):With these exposed methods, now I can display more "complex" views, such as:

Pardon the styling, just a placeholder.