Skip to content

Commit

Permalink
Adds handling for IndexError.
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Sep 7, 2017
1 parent b8256e9 commit 98e8022
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spyder/widgets/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,8 +1703,13 @@ def current_changed(self, index):

self.update_plugin_title.emit()
if editor is not None:
self.current_file_changed.emit(self.data[index].filename,
# Needed in order to handle the close of files open in a directory
# that has been renamed. See issue 5157
try:
self.current_file_changed.emit(self.data[index].filename,
editor.get_position('cursor'))
except IndexError:
pass

def _get_previous_file_index(self):
if len(self.stack_history) > 1:
Expand Down

0 comments on commit 98e8022

Please sign in to comment.