-
-
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: Change for file save on split editor when tabs are moved #5784
Conversation
Hello @csabella! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on November 19, 2017 at 13:57 Hours UTC |
@@ -1690,8 +1780,6 @@ def save_copy_as(self, index=None): | |||
txt = to_text_string(finfo.editor.get_text_with_eol()) | |||
try: | |||
finfo.encoding = encoding.write(txt, filename, finfo.encoding) | |||
self.file_saved.emit(str(id(self)), index, filename) |
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.
Why is this not needed anymore?
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.
@ccordoba12 The copy as
function creates a new file with the same information as the current index, but it doesn't make any changes to the current index or current filename (in the tab or the self.data). The file_saved.emit
was updating the other split panels for the current index/filename, but this isn't necessary since it's not changed at all.
It's simple to recreate to see what's happening, even without moving tabs.
- Open one file in one panel.
- Split horizontally or vertically.
- Click
save_copy_as
and save the file under a new name. You'll see the new file open in both panels, so there are now 2 tabs. - Click focus onto the other panel.
- Notice that both tabs get updated with the same file name and no longer match the first panel.
This one really isn't related to moving tabs, but I found it while testing my changes. If you want, I can move it to a separate PR.
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.
Don't worry, it's really good that you have detected and solved this problem as part of this PR.
Thanks for your contribution @csabella! It looks good to me, except for a minor comment I left. Please also fix the style issues reported by |
I think the reason why Pierre (Spyder's original author) didn't implement the functionality to move tabs in the Editor before was because of all the issues that would arise with split panes. But thanks to the great work of Cheryl and @jnsebgosselin, now this is a thing from the past!! |
Fixes #5703.
This affected
save()
,save_as()
, andsave_copy_as()
directly. Also added changes forset_todo_results()
andset_analysis_results()
as they were affected by the issue of using the same index across editor stacks.