mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #472] Improve support for using colors in autocomplete input fields? #342
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#342
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @khughitt on GitHub (Jul 18, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/472
One more quick idea --
Would it be possible to modify autocomplete to make it easier to include choices which are colored differently?
Currently, autocomplete display text in different colors just fine, however, to actually match one of the words, you have to type the color expression in the input field.
For example, for the string "[#ff0000] word" to match, you have to start with the "[".
It would be nice if there was an option to indicate that colors should still be displayed in the autocomplete options, but otherwise stripped from the strings that are being matched against.
Another possible approach would be to allow Maps to be used, with each entry corresponding to a
(label, text)pair.@khughitt commented on GitHub (Jul 18, 2020):
Nevermind!
Just realized this was my fault for using
strings.HasPrefix()in theinputField.SetAutocompleteFunc()function.Switching to a different approach to matching fixed the issue.
Please ignore :)
@khughitt commented on GitHub (Jul 18, 2020):
Reopening for different but related issue (still having to do with color + autocomplete support):
when navigating through autocomplete choices, colors and formatting are rendered as expected, however, in the text that is shown in the inputField, the unformatted text (e.g.
[#ff0000][::b]match...) is shown instead of the rendered text.@rivo commented on GitHub (Sep 15, 2020):
That's actually a bug. Colour tags should not appear in the input field when you make an autocomplete selection. I fixed this in the latest commit.
@khughitt commented on GitHub (Sep 15, 2020):
Thanks for the fix! It's much appreciated.