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

PR: Activate Open last closed shortcut in EditorStack (Editor) #22914

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

jitseniesen
Copy link
Member

@jitseniesen jitseniesen commented Nov 8, 2024

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

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.
@jitseniesen jitseniesen self-assigned this Nov 8, 2024
@dalthviz dalthviz added this to the v6.0.3 milestone Nov 8, 2024
@ccordoba12 ccordoba12 changed the title Activate "Open last closed" shortcut in EditorStack PR: Activate "Open last closed" shortcut in EditorStack Nov 9, 2024
The quick and dirty solutions in the last commit did not work with
our tests, so this commit does it properly.
@ccordoba12 ccordoba12 requested a review from dalthviz November 9, 2024 18:55
@ccordoba12
Copy link
Member

@dalthviz, please review @jitseniesen's works.

@jitseniesen
Copy link
Member Author

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.

Copy link
Member

@dalthviz dalthviz left a 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 ?

@dalthviz dalthviz changed the title PR: Activate "Open last closed" shortcut in EditorStack PR: Activate Open last closed shortcut in EditorStack (Editor) Nov 11, 2024
@ccordoba12
Copy link
Member

Nop, I'm fine with your review. Please merge and backport it.

@dalthviz dalthviz merged commit 5a2851f into spyder-ide:master Nov 12, 2024
17 checks passed
@dalthviz
Copy link
Member

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/spyder that referenced this pull request Nov 12, 2024
dalthviz added a commit that referenced this pull request Nov 13, 2024
…914-on-6.x

Backport PR #22914 on branch 6.x (PR: Activate `Open last closed` shortcut in `EditorStack` (Editor))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open last closed shortcut (Ctrl+Shift+T) does not work
3 participants