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: Update only current editor stack when moving tabs. #4850

Merged
merged 1 commit into from
Jul 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions spyder/plugins/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2681,6 +2681,7 @@ def set_create_new_file_if_empty(self, value):
for editorstack in self.editorstacks:
editorstack.create_new_file_if_empty = value

@Slot(int, int)
def move_editorstack_data(self, start, end):
"""Move editorstack.data to be synchronized when tabs are moved."""
if start < 0 or end < 0:
Expand All @@ -2689,12 +2690,13 @@ def move_editorstack_data(self, start, end):
steps = abs(end - start)
direction = (end-start) // steps # +1 for right, -1 for left

for editorstack in self.editorstacks :
data = editorstack.data
editorstack.blockSignals(True)
for editorstack in self.editorstacks:
if editorstack.isAncestorOf(self.sender()):
data = editorstack.data
editorstack.blockSignals(True)

for i in range(start, end, direction):
data[i], data[i+direction] = data[i+direction], data[i]
for i in range(start, end, direction):
data[i], data[i+direction] = data[i+direction], data[i]

editorstack.blockSignals(False)
editorstack.refresh()
editorstack.blockSignals(False)
editorstack.refresh()