Hammerspoon / hammerspoon

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

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

Open Sleepful opened 2 weeks ago

Sleepful commented 2 weeks 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 weeks 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 weeks ago

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

latenitefilms commented 2 weeks ago

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