Skip to content

Commit

Permalink
Rename variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Jun 15, 2015
1 parent df71c2e commit 7013d91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spyderlib/widgets/sourcecode/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ def keyPressEvent(self, event):
if self.type_list[self.currentRow()] not in ['class', 'function',
'method']:
return
parent = self.textedit
s_trailing_text = parent.get_text('cursor', 'eol').strip()
if parent.close_parentheses_enabled and \
edit = self.textedit
s_trailing_text = edit.get_text('cursor', 'eol').strip()
if edit.close_parentheses_enabled and \
(len(s_trailing_text) == 0 or \
s_trailing_text[0] in (',', ')', ']', '}')):
parent.insert_text('()')
cursor = parent.textCursor()
edit.insert_text('()')
cursor = edit.textCursor()
cursor.movePosition(QTextCursor.PreviousCharacter)
parent.setTextCursor(cursor)
edit.setTextCursor(cursor)
elif key in (Qt.Key_Return, Qt.Key_Enter,
Qt.Key_Left, Qt.Key_Right) or text in ('.', ':'):
self.hide()
Expand Down

0 comments on commit 7013d91

Please sign in to comment.