-
-
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: Activate Open last closed
shortcut in EditorStack
(Editor)
#22914
Conversation
The proper way to implement this is perhaps via a signal instead of using get_main_widget(). The plan is to replace this code in Spyder 6.1 as part of the move of all file actions out of the Editor plugin.
The quick and dirty solutions in the last commit did not work with our tests, so this commit does it properly.
@dalthviz, please review @jitseniesen's works. |
The quick and dirty implementation in the first commit did not work with our tests (which I should have expected). So I used the alternative and more proper design with the editor stack sending a signal to the main widget to request that the last closed file be opened again. |
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 @jitseniesen ! Checked this locally and I think is working as expected!
Thinking about this, maybe it could be worthy to somehow add a test for this shortcut? But anyhow this LGTM so leaving it approved 👍
Also, just in case, do you have any feedback @ccordoba12 ?
Open last closed
shortcut in EditorStack
(Editor)
Nop, I'm fine with your review. Please merge and backport it. |
@meeseeksdev please backport to 6.x |
…t in `EditorStack` (Editor)
…914-on-6.x Backport PR #22914 on branch 6.x (PR: Activate `Open last closed` shortcut in `EditorStack` (Editor))
Description of Changes
This fixes the "Open last closed" shortcut in the editor, which stopped working in Spyder 6.
The proper way to implement this is perhaps via a signal instead of using get_main_widget(). However, I intend to replace this code in Spyder 6.1 as part of the fix for issue #22354, which will move all the shortcuts and actions for New/Open/Close/Save from the Editor plugin to the Application plugin, so that other plugins can also open and edit files. A minimal change seems better in this case.Issue(s) Resolved
Fixes #22912
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:
Jitse Niesen