Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2101 from Carreau/fixes-2082

Fix completer deleting newline in qtconsole.

Fixes #2082.
  • Loading branch information...
commit 811283a3eb61abe46a727dd3b60f8d0cceee6235 2 parents 56d2be5 + dd5f651
@fperez fperez authored
Showing with 9 additions and 8 deletions.
  1. +9 −8 IPython/frontend/qt/console/console_widget.py
View
17 IPython/frontend/qt/console/console_widget.py
@@ -884,15 +884,16 @@ def _clear_temporary_buffer(self):
the prompt region.
"""
# Select and remove all text below the input buffer.
- _temp_buffer_filled = False
cursor = self._get_prompt_cursor()
prompt = self._continuation_prompt.lstrip()
- while cursor.movePosition(QtGui.QTextCursor.NextBlock):
- temp_cursor = QtGui.QTextCursor(cursor)
- temp_cursor.select(QtGui.QTextCursor.BlockUnderCursor)
- text = temp_cursor.selection().toPlainText().lstrip()
- if not text.startswith(prompt):
- break
+ if(self._temp_buffer_filled):
+ self._temp_buffer_filled = False
+ while cursor.movePosition(QtGui.QTextCursor.NextBlock):
+ temp_cursor = QtGui.QTextCursor(cursor)
+ temp_cursor.select(QtGui.QTextCursor.BlockUnderCursor)
+ text = temp_cursor.selection().toPlainText().lstrip()
+ if not text.startswith(prompt):
+ break
else:
# We've reached the end of the input buffer and no text follows.
return
@@ -945,7 +946,7 @@ def _fill_temporary_buffer(self, cursor, text, html=False):
self._control.moveCursor(QtGui.QTextCursor.End)
self._control.setTextCursor(cursor)
- _temp_buffer_filled = True
+ self._temp_buffer_filled = True
def _context_menu_make(self, pos):
Please sign in to comment.
Something went wrong with that request. Please try again.