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

Move selection back to best match if initial selection position is different #111

Open
firecat53 opened this issue May 2, 2022 · 3 comments

Comments

@firecat53
Copy link

If you scroll down the selection list before you start typing, the selection position does not move back up to the best match (the first item) as I would expect when I start typing. In fact, you'll never end up with the exact match selected even if you type it exactly.

I hope I'm explaining that right.

Here I've scrolled down to 'Clocks' (the blue is the selected item)

scrolled down

Now I type 'flatseal' but it does not get selected as I would expect as soon as I type fl.

flatseal not selected

@l4l
Copy link
Owner

l4l commented May 2, 2022

Cursor is forced to be in a range 0..<num-of-entries>. So after the number of displayed entries are reduced the cursor is decreased to maintain this invariant. And if you clear the input you may notice it doesn't point back to Clocks entry. Essentially there's no special cursor handling except arrows (and similar).

I feel current behavior more intuitive rather than resetting cursor for cases like exact match. Also it seems rofi does the same.

Though the matching sometimes looks too fuzzy then it should be. Perhaps there should be some scoring threshold for filtered entries.

@l4l
Copy link
Owner

l4l commented May 2, 2022

Uh, yeah. I remembered why it has so weird listing. It matches name with keywords so at least for LibreOffice there should be pretty high score (it has a lot of keywords).

What do you think about additional parameter for search that actually changes matching only against the displayed name? For that particular case exact match will work as you want however typos are not "mitigated" by keywords (e.g flateasl won't find anything).

@firecat53
Copy link
Author

firecat53 commented May 2, 2022

I think there's something else weird going on. You shouldn't need to add any extra options to Yofi.

You can see that 'Alacritty' is at the top of my application list. If I scroll (down arrow) down maybe halfway through my complete list and then start typing 'alac', alacritty isn't even shown as an option. If I only scroll down a few items it is. Yofi should find an application no matter where you are in the list. The same thing happens for VSCodium, which is towards the bottom of the list. If I don't scroll at all, Yofi finds the relevant applications perfectly. However, any significant scrolling through the list before typing seems to really mess up the results.

If you can't replicate, I'll post a screencast.

Edit: If you can, try bemenu-run and notice how it finds options regardless of where you are scrolled to in the list, even with some (not all) misspellings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants