Spyder: Save after moving editor tabs with split panes changes wrong files

Created on 8 Nov 2017  路  8Comments  路  Source: spyder-ide/spyder

I couldn't find if this was an open issue, so I apologize if it's a duplicate.

If the editor is open with split panes and the tabs are manually moved in the panes, after editing and saving a tab (file) that is in a different order than the split, the other pane then is updated with the information in the same order. Following the steps to reproduce will make this more clear than a description.

What steps will reproduce the problem?

  1. Note: do this on a test file, not a real one!
  2. Open three files in the editor.
  3. Split vertically or horizontally.
  4. Move the order of the tabs on the top pane, so instead of 1-2-3, it's now 3-2-1 (or whatever). The split pane stays in order 1-2-3.
  5. Edit the file on tab 3 and then click save.
  6. Click on the split pane.
  7. The name of the file on tab 3 changes to match pane 1, but the file doesn't change. So, the split panel now has 2 tabs open that point to the same file name.
  8. Edit the file in the split panel where the tab name changed and then save. Notice that all the open files now match that data -- even the ones that originally had different names.

What is the expected output? What do you see instead?
I expect the file names on the tabs to not change and the text on each file to sync between tabs based on filename, not based on tab position.

Please provide any additional information below

Versions and main components

  • Spyder Version: 3.x and 4.x
  • Python Version: 3.6.3
  • Qt Version: 5.6.2
  • PyQt Version: PyQt5 5.6
  • Operating system: Ubuntu

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

Editor Bug

All 8 comments

I can reproduce this issue, This is related to #5271

I think this is caused for the issues that I mentioned in #5315

Thanks! This is exactly the same as #5271. Any of the editor stack methods that use index instead of filename would be affected the same way.

This is exactly the same as #5271

But #5271 is already fixed. What should we do here then?

Thanks! This is exactly the same as #5271

It's similar, #5271 was related to closing files, this is related to saving files

Any of the editor stack methods that use index instead of filename would be affected the same way.

Yes, probably, but if we are lucky the only one is the save method

@csabella, do you want to work on this one?

@ccordoba12 Sure, I can work on this.

Great, thanks!

If it is of any help, I experienced this myself on Win 10 Ent x64 just yesterday and was going to report, but couldn't figure out exactly how it was triggered to reproduce it. However, this indeed appears to be the exact issue that happened, as moving around a tab reproduces it just now. Also, I note that if Spyder is then closed and reopened (without saving/overwriting the files), the file that was moved is not loaded in the session at all, and needs to be manually re opened.

Was this page helpful?
0 / 5 - 0 ratings