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

Prefer 3-character matches, use labels as fallback #105

Open
duarm opened this issue Feb 13, 2023 · 2 comments
Open

Prefer 3-character matches, use labels as fallback #105

duarm opened this issue Feb 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@duarm
Copy link

duarm commented Feb 13, 2023

the labels are predefined and consistent, not contextual. Consider this situation

image

If I leap and type "ru", I'll get this

image

but it seems natural and better for the hints to be "d" and "r", and fallback to the predefined ones in order to disambiguate between equal targets.

Is there a way to achieve this behaviour?

@ggandor
Copy link
Owner

ggandor commented Feb 14, 2023

This would be great, already thought about it lots of times, but it only works if "autojumping" is disabled. (A pair can be followed by any character, so there would be no available "safe" label characters at all.) So yeah, the idea is perfectly valid, but this would result in an ugly inconsistency, using a very different algorithm depending on user settings.

Also, we can say goodbye to the invariant that a match is always 2 characters. Displaying the 3rd char as a "label" would be confusing I guess, and wouldn't help much, I'd highlight all the 3 characters with LeapMatch, obviously. But the consistent "2 on-screen chars + [maybe-label]" is a much simpler mental model. I don't know, it should be tried in practice, maybe I'll implement it when I'll have lots of free time, just for the heck of it. Still, I don't think even in that case we should actually add this to Leap, for the above mentioned reason (it cannot work in all cases), especially considering that "autojump" is the default, suggested mode of the plugin.

@duarm
Copy link
Author

duarm commented Feb 15, 2023

A pair can be followed by any character, so there would be no available "safe" label characters at all.

The possibilities are: Unique Match (autojump), multiple match (contextual label until Unique Match, if you press CTRL, you cycle to the next match). On the last case, can't we bind a meta key like CTRL to cycle between those ?

I get the consistency argument, the described behaviour makes jumping to an unique text more natural, but you can't count with it 100%, incurring on additional key strokes when there are a bunch of equal text. We already have to react to the label in order to jump, so maybe it averages for the better? It depends on the text and actual testing would make it more clear which behaviour feels better.

@ggandor ggandor changed the title leap labels match actual target text Prefer 3-character matches to labels Feb 17, 2023
@ggandor ggandor added the enhancement New feature or request label Feb 17, 2023
@ggandor ggandor changed the title Prefer 3-character matches to labels Prefer 3-character matches, use labels as fallback Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants