You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking into adding fuzzy history search in nushell, and one thing that it really needs is the ability to highlight the matched part of each item.
Columnar menu already supports something a bit familiar - highlighting the matched prefix via selected_match_style. But for fuzzy matching, we need to be able to highlight arbitrary parts of an item, eg.
query: oa
match: foobar
So I think this would need a new field in the Suggestion struct, describing which characters are matched.
The most straightforward/natural way for one could be:
/// An increasing list of char (not byte!) indices describing which characters from the `value` field are considered matched.
matches:Option<Vec<usize>>
Any thoughts on that? I imagine the "increasing" part can be questionable, API-wise, though makes the implementation simpler and in practice the user is likely to have it already sorted.
I'm happy to send s PR.
The text was updated successfully, but these errors were encountered:
I'm looking into adding fuzzy history search in nushell, and one thing that it really needs is the ability to highlight the matched part of each item.
Columnar menu already supports something a bit familiar - highlighting the matched prefix via selected_match_style. But for fuzzy matching, we need to be able to highlight arbitrary parts of an item, eg.
query: oa
match: foobar
So I think this would need a new field in the Suggestion struct, describing which characters are matched.
The most straightforward/natural way for one could be:
Any thoughts on that? I imagine the "increasing" part can be questionable, API-wise, though makes the implementation simpler and in practice the user is likely to have it already sorted.
I'm happy to send s PR.
The text was updated successfully, but these errors were encountered: