Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua
http://www.hammerspoon.org
MIT License
12.13k stars 586 forks source link

[Feature Request]: `hs.chooser` callback function to filter the results #3688

Open Sleepful opened 2 months ago

Sleepful commented 2 months ago

Allow the user to set their own "filtering" function for results within the chooser based on the query.

This would allow the user to create their own algorithm to search the results, such as fuzzy searching or something else.

Fuzzy searching idea mentioned here:

https://github.com/Hammerspoon/hammerspoon/issues/1149

latenitefilms commented 2 months ago

I'm pretty sure this is already possible? You can change what the chooser displays however/whenever you want.

Maybe have a look at:

https://github.com/CommandPost/CommandPost/blob/develop/src/plugins/core/action/manager/activator.lua

Sleepful commented 2 months ago

@latenitefilms I will take a look, I didn't find anything inside https://www.hammerspoon.org/docs/hs.chooser.html

latenitefilms commented 2 months ago

Just watch queryChangedCallback() to changes to the query, and update the choices accordingly?