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

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

Merged
merged 4 commits into from
Nov 2, 2022

Conversation

halfwit
Copy link
Contributor

@halfwit halfwit commented Jun 12, 2022

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.

Copy link

@github-actions github-actions bot left a comment

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

Copy link
Member

@cmsj cmsj left a comment

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.

extensions/chooser/HSChooser.m Outdated Show resolved Hide resolved
@cmsj cmsj added the pr-change Pull Request changing behaviour label Jul 1, 2022
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

View Test Results

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

Results for commit 56aa797.

@halfwit
Copy link
Contributor Author

halfwit commented Jul 1, 2022

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
Copy link
Member

cmsj commented Nov 2, 2022

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