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: Add support for other plugins in File Switcher #4290

Merged
merged 2 commits into from
Mar 25, 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
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