Skip to content

Commit

Permalink
Merge from 3.1.x: PR #4290
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Mar 25, 2017
2 parents be8b750 + dc33ce4 commit ea763c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spyder/widgets/fileswitcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,12 @@ def save_initial_state(self):
for i, editor in enumerate(self.editors):
if editor is self.initial_editor:
self.initial_path = paths[i]
self.initial_cursors[paths[i]] = editor.textCursor()
# This try is needed to make the fileswitcher work with
# plugins that does not have a textCursor.
try:
self.initial_cursors[paths[i]] = editor.textCursor()
except AttributeError:
pass

def accept(self):
self.is_visible = False
Expand Down Expand Up @@ -437,7 +442,7 @@ def get_editor(self, index=None, path=None):
elif path:
return self.tabs.widget(index)
else:
return self.parent().get_current_editor()
return self.tabs.currentWidget()

def set_editor_cursor(self, editor, cursor):
"""Set the cursor of an editor."""
Expand Down

0 comments on commit ea763c3

Please sign in to comment.