feat: Add filter_keybinding to KeyBindingRegistry#212
Merged
tlambert03 merged 10 commits intopyapp-kit:mainfrom Jul 19, 2024
Merged
feat: Add filter_keybinding to KeyBindingRegistry#212tlambert03 merged 10 commits intopyapp-kit:mainfrom
filter_keybinding to KeyBindingRegistry#212tlambert03 merged 10 commits intopyapp-kit:mainfrom
Conversation
filter_keybinding to KeyBindingRegistryfilter_keybinding to KeyBindingRegistry
lucyleeow
commented
Jul 11, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 31 31
Lines 1814 1833 +19
=========================================
+ Hits 1814 1833 +19 ☔ View full report in Codecov by Sentry. |
tlambert03
reviewed
Jul 11, 2024
Member
There was a problem hiding this comment.
looks good, but we need to catch the new possible ValueError inside of the for loop in register_action_keybindings
if d := self.register_keybinding_rule(action.id, _keyb):
disposers.append(d)otherwise one bad keybinding will ruin the whole batch (and add a test for that)
Collaborator
Author
|
Thanks @tlambert03, I think changes are made. I will look at any doc updates once code okay. |
tlambert03
reviewed
Jul 19, 2024
Member
tlambert03
left a comment
There was a problem hiding this comment.
thanks @lucyleeow, perfect 👌
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #206
Adds a
filter_keybinding(not 100% on name) attr toKeyBindingRegistry, which takesCallable[[KeyBinding], str]- if str is empty the keybinding is valid otherwise error message str should be returned.Just a start, happy to take any feedback.
Will update docs once code ready.