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

Add contextual when to keyboard shortcuts #77

Closed
brunoais opened this issue Feb 4, 2024 · 2 comments · Fixed by #85
Closed

Add contextual when to keyboard shortcuts #77

brunoais opened this issue Feb 4, 2024 · 2 comments · Fixed by #85

Comments

@brunoais
Copy link

brunoais commented Feb 4, 2024

Is your feature request related to a problem? Please describe.
I'd like to reuse keyboard shortcuts that are already used for something else for twinny.
In my case,

  1. CTRL+SHIFT+Enter to cancel bot generating text.
  2. CTRL+SHIFT+Space to prompt the bot to try to guess what code comes next.

However, those keys are already assigned to other shortcuts which I also would like having for those shortcuts.
However, they don't apply to the same contexts.

Describe the solution you'd like
I'd like the provided shortcuts to already contain context evaluation from the get-go so the shortcuts only apply when the context makes sense.
For example, the key so the bot stops, can be limited only to the context of the bot generating a message (and 0.5-1s grace period). See:
https://code.visualstudio.com/api/references/when-clause-contexts#add-a-custom-when-clause-context

The key to prompt the bot to trigger an inline suggestion can be only active when the user is focusing on the editor (or other similar contexts).

Describe alternatives you've considered
Make the shortcuts more complex, such as 2 stage shortcut to try to avoid the clash. Takes a long time if I keep wanting suggestions but not suggestions on each key press.

Additional context
(Kept the original shortcuts in this shot so you can identify them more easily)
image

Thank you for this tool!

@rjmacarthy
Copy link
Collaborator

Thanks for the support, I have just added contextual when clauses to the keybindings.

@brunoais
Copy link
Author

brunoais commented Feb 5, 2024

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants