Cloudef / bemenu

Dynamic menu library and client program inspired by dmenu
GNU General Public License v3.0
1.22k stars 94 forks source link

feature request: maintain input item order #354

Closed prokrypt closed 1 year ago

prokrypt commented 1 year ago

Hi! I use bemenu as a launcher, and its input comes from a custom script that sorts items by frequency of use. It would be nice if bemenu has an option to maintain this sorting when filtering.

Cloudef commented 1 year ago

but it does?

prokrypt commented 1 year ago

echo -e "three one\ntwo one\none one" | bemenu At the moment, searching for "one" will alter the order and put "one one" first. I don't know what the particular search style is called, but I would like an option to maintain the order no matter what.

prokrypt commented 1 year ago

I believe fuzzel does it the way I want: ss

Cloudef commented 1 year ago

I see what you mean now. Bemenu mimics the dmenu matching behavior (I believe it's called prefix matching), where exact match is weighted most followed by matches that start with your first search token. If you are fine with patching the source you can remove these if branches and should end up with the behavior you are after https://github.com/Cloudef/bemenu/blob/master/lib/filter.c#L130-L138

prokrypt commented 1 year ago

Ah, that seems easy enough. For now it looks like I'm better able to wrangle fuzzel to display how I want it to, but if I decide I want some change I'll give patching bemenu a go.

Thanks! \o/