-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implement Undo
& Redo
keyboard shortcuts
#382
Conversation
I studied QuantStack/jupytergis#58, i limited the selector to be the jupytercad-panel for undo & redo. Need one opinion- having Edit: I personally feel that having a |
Yep I think that looks good 👍🏽 Thanks It looks like your PR is now conflicting with the main branch, due to the merge of the other PR |
Resolving this branch asap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I define body as the selector, these keybindings enables for whole app.
It is fine in that case if we don't want to have key bindings irrespective of which component is focused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! Thanks a lot
Arg. It seems the redo keyboard shortcut does not work. |
Hi @SylvainCorlay, I just tested these keyboard shortcuts locally and on https://jupytercad.github.io/JupyterCAD/ as well and it seems to be working as expected for me on both the places. Screen.Recording.2024-08-02.232030.mp4However on a sidenote, I'd like to mention that we had an issue with the redo function in the past, which has been fixed recently by #385, thanks to @trungleduc. So in case you're trying this out locally, I'd once suggest to make sure that the code is properly synced to upstream. But in case the issue still persists, please let us know about the same. Thanks a lot for following up on this, I'd be more than happy to assist further. |
Thanks for looking into it. The issue may be specific to the JupyterLite deployment. |
This is a rough try of me in which I tried to introduce simple
keybindings
forundo
&redo
i.e.Ctrl
+z
for undoCtrl
+y
for redoSummary of What I Did:
keybindings.json
in which I have defined keybindings for undo and redo.addCommands()
function to load the keybindings.loadKeybindings
to register the keybindings with the command registry.