-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Fix shortcuts for several Run and Debugger actions #22230
PR: Fix shortcuts for several Run and Debugger actions #22230
Conversation
- Improve how shortcuts are registered in widgets. - Use that mixin in other places where we need to get/set shortcuts. - Remove code related to shortcuts from SpyderConfigurationAccessor - Remove unnecessary code related to the old way of registering shortcuts for widgets.
Hello @ccordoba12! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-07-06 15:41:45 UTC |
- Also make run cell and selection in debugger shortcuts work only for the editor. - And set a new shortcut for run selection in debugger.
And remove it from the Online Help.
That code is not necessary anymore.
Also, remove unnecessary calls to shortcuts.apply_shortcuts()
That was computed correctly if the Debugger is not focused at startup.
0cb4a19
to
f077988
Compare
@dalthviz, this is ready for review. |
Gave this an initial check and seems like there are missing changes to cover shortcuts for plugins like Code Analysis and Profiler? With this I'm unable to trigger via shortcuts the profiler ( |
- That's necessary to create EditorMainWindow's independently of the Editor (e.g. for testing). - Also, fix a test related to shortcuts and add a clarifying comment.
f077988
to
4a3a5fd
Compare
That's right, I didn't check those shortcuts. But they should be working now, so please test again. |
Note: Could this be related with #14403 ? |
Yep, that's mostly the same problem. But in the case of the Editor, the thing is that And we can't create It's a tricky problem that we have to think better. For now I think what I did is just a stopgap solution. |
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.
Thanks @ccordoba12 ! Checked locally and seems like things are working, so this LGTM 👍
Description of Changes
Run cell
,Run cell and advance
and other Run actions, as well asnext
,continue
and other Debugger actions, local to the Editor again.SpyderShortcutsMixin
tospyder.api.shortcuts
and use it to simplify the way shortcuts are registered for widgets. That's necessary when a widget is not a direct child of the one where an action with shortcut was created (e.g. theEditorStack
with respect toEditorMainWidget
).Ctrl+Shift+D
as the new shortcut to go to the Debugger (and remove that shortcut for the Online Help).array_builder
toeditor
. That follows the convention already used in the IPython console.Note
There's still a limitation (also present in Spyder 5) with shortcuts registered for widgets: they are not updated after a change in Preferences. I tried to fix that as part of this PR but it requires several changes to the way shortcut options are tracked and notified, so I prefer to leave it for a follow-up one.
Issue(s) Resolved
Fixes #21129.
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: @ccordoba12