Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve matching of CharSelect #5532

Closed
al1-ce opened this issue Jun 8, 2024 · 9 comments
Closed

Improve matching of CharSelect #5532

al1-ce opened this issue Jun 8, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@al1-ce
Copy link

al1-ce commented Jun 8, 2024

Is your feature request related to a problem? Please describe.
When I'm trying to get unicode characters it's extremely frustrating that results are completely unrelated to search. Example:

image

On top is kitten unicode-input, on bottom wezterm's CharSelect. Top results are fairly close to what I need (and to be honest look way better), bottom are absolutely not what I want to find

Describe the solution you'd like
Fuzzy search instead of what it's right now

Describe alternatives you've considered
Using kitty's char select which doesn't work with wezterm, i.e can't select characters or backspace to delete typed term

@al1-ce al1-ce added the enhancement New feature or request label Jun 8, 2024
@wez
Copy link
Owner

wez commented Jul 13, 2024

FWIW, the results you are seeing right now are fuzzy matches, produced by https://crates.io/crates/fuzzy-matcher
It just so happens that line is fuzzy matching closer to linux than low line with its algorithm.

@al1-ce al1-ce changed the title Ability to fuzzy match when using CharSelect Improve matching of CharSelect Jul 14, 2024
@al1-ce
Copy link
Author

al1-ce commented Jul 14, 2024

Strange, it should matching line related things first instead of linux then...

Maybe it's worth implementing something like https://dlang.org/library/std/numeric/gap_weighted_similarity_normalized.html ? In my experience it does very good matching.

@bew
Copy link
Contributor

bew commented Jul 14, 2024

Maybe we could replace the use of the fuzzy-matcher crate with nucleo, which is both much faster and uses the same scoring system as fzf 🤔

@al1-ce
Copy link
Author

al1-ce commented Jul 14, 2024

Imo nucleo looks good and if they're right about similar matching to fzf it'd certainly be better choice

@wez
Copy link
Owner

wez commented Jul 14, 2024

FWIW, I did a quick test with the nucleo-matcher and I'm not convinced this is what you want either:

image

@al1-ce
Copy link
Author

al1-ce commented Jul 14, 2024

Tbh looks better then before

What if to trick it by adding spaces before and after input string? Should probably trick matcher..?

I would've tested some things myself (namely trying to implement gap weight similarity algorithm), but I'm very unfamiliar with rust and didn't really liked it when I tried

wez added a commit that referenced this issue Jul 14, 2024
This has more intuitive sorting; eg: `line` used to show the first match
as `linux_endeavour` but now matches `LINEAR B IDEOGRAM VESSEL B212`
first, which feels more relevant (has an exact prefix match).

refs: #5532
@wez
Copy link
Owner

wez commented Jul 14, 2024

I've switched this to nucleo in main. I have low interest in trying to actively game the algorithm. I think that matching linear... before low line is totally reasonable in this situation.

Note that once you select low line once, it will appear in the recent list making it quicker to reuse again.

@al1-ce
Copy link
Author

al1-ce commented Jul 14, 2024

That is fair, it's way better then it was before and personally I'm ok with that, so, close when ready

@wez wez closed this as completed in b20c619 Jul 14, 2024
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants