Skip to content

Commit

Permalink
Merge pull request #5163 from dalthviz/fixes_issue_5157
Browse files Browse the repository at this point in the history
PR: Add handling for IndexError in the Editor when renaming folder containing file
  • Loading branch information
ccordoba12 authored Sep 7, 2017
2 parents b8256e9 + 98e8022 commit 066df79
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 066df79

Please sign in to comment.