Skip to content

Commit

Permalink
Fix error with unwanted scrolling when selectiong a tab. Issue: 1170
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaverde committed Jan 13, 2017
1 parent 32f76b8 commit b4b93e7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spyder/widgets/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def setup_editorstack(self, parent, layout):
# a crash when the editor is detached from the main window
# Fixes Issue 561
self.tabs.setDocumentMode(True)
self.tabs.currentChanged.connect(self.current_changed)
self.tabs.currentChanged.connect(self.current_changed_tabs)

if sys.platform == 'darwin':
tab_container = QWidget()
Expand Down Expand Up @@ -1439,14 +1439,17 @@ def get_todo_results(self):
if self.data:
return self.data[self.get_stack_index()].todo_results

def current_changed(self, index):
def current_changed_tabs(self, index):
self.current_changed(index, set_focus=False)

def current_changed(self, index, set_focus=True):
"""Stack index has changed"""
# count = self.get_stack_count()
# for btn in (self.filelist_btn, self.previous_btn, self.next_btn):
# btn.setEnabled(count > 1)

editor = self.get_current_editor()
if index != -1:
if index != -1 and set_focus:
editor.setFocus()
if DEBUG_EDITOR:
print("setfocusto:", editor, file=STDOUT)
Expand Down

0 comments on commit b4b93e7

Please sign in to comment.