Skip to content

Allow hs.chooser query to still be forwarded when no matching string exists - #3232

Merged
cmsj merged 4 commits into
Hammerspoon:masterfrom
halfwit:master
Nov 2, 2022
Merged

Allow hs.chooser query to still be forwarded when no matching string exists#3232
cmsj merged 4 commits into
Hammerspoon:masterfrom
halfwit:master

Conversation

@halfwit

@halfwit halfwit commented Jun 12, 2022

Copy link
Copy Markdown
Contributor

This is an example of how to implement this, it works in my local testing.
It adds a method, enableDefaultForQuery which can be passed a bool to allow the query to be returned to the final handler, even when it doesn't match an item on the choices list.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: pr-fix, pr-change, pr-feature, pr-maintenance

@cmsj cmsj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the look of this, and I also wonder if it might be worth adding the query string to the choice dictionary even when a valid choice exists? That doesn't need to be part of this PR, but we should do the LUA_NOREF/LUA_REFNIL checks before merging.

Comment thread extensions/chooser/HSChooser.m Outdated
@cmsj cmsj added the pr-change Pull Request changing behaviour label Jul 1, 2022
@github-actions

github-actions Bot commented Jul 1, 2022

Copy link
Copy Markdown

View Test Results

342 tests   290 ✔️  11m 32s ⏱️
    2 suites    52 💤
    1 files        0

Results for commit 56aa797.

@halfwit

halfwit commented Jul 1, 2022

Copy link
Copy Markdown
Contributor Author

Sorry about the commit/revert, not sure what VSCode was doing there.

@halfwit
halfwit marked this pull request as ready for review July 1, 2022 18:55
@cmsj
cmsj merged commit 2b86d82 into Hammerspoon:master Nov 2, 2022
@cmsj

cmsj commented Nov 2, 2022

Copy link
Copy Markdown
Member

Thanks! Apologies for the slow merging

@cmsj cmsj changed the title Allow the query to still be forwarded when no matching string exists Allow hs.chooser query to still be forwarded when no matching string exists Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-change Pull Request changing behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants