##// END OF EJS Templates
Merge pull request #2101 from Carreau/fixes-2082...
Fernando Perez -
r7821:811283a3 merge
parent child Browse files
Show More
@@ -884,15 +884,16 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
884 the prompt region.
884 the prompt region.
885 """
885 """
886 # Select and remove all text below the input buffer.
886 # Select and remove all text below the input buffer.
887 _temp_buffer_filled = False
888 cursor = self._get_prompt_cursor()
887 cursor = self._get_prompt_cursor()
889 prompt = self._continuation_prompt.lstrip()
888 prompt = self._continuation_prompt.lstrip()
890 while cursor.movePosition(QtGui.QTextCursor.NextBlock):
889 if(self._temp_buffer_filled):
891 temp_cursor = QtGui.QTextCursor(cursor)
890 self._temp_buffer_filled = False
892 temp_cursor.select(QtGui.QTextCursor.BlockUnderCursor)
891 while cursor.movePosition(QtGui.QTextCursor.NextBlock):
893 text = temp_cursor.selection().toPlainText().lstrip()
892 temp_cursor = QtGui.QTextCursor(cursor)
894 if not text.startswith(prompt):
893 temp_cursor.select(QtGui.QTextCursor.BlockUnderCursor)
895 break
894 text = temp_cursor.selection().toPlainText().lstrip()
895 if not text.startswith(prompt):
896 break
896 else:
897 else:
897 # We've reached the end of the input buffer and no text follows.
898 # We've reached the end of the input buffer and no text follows.
898 return
899 return
@@ -945,7 +946,7 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
945 self._control.moveCursor(QtGui.QTextCursor.End)
946 self._control.moveCursor(QtGui.QTextCursor.End)
946 self._control.setTextCursor(cursor)
947 self._control.setTextCursor(cursor)
947
948
948 _temp_buffer_filled = True
949 self._temp_buffer_filled = True
949
950
950
951
951 def _context_menu_make(self, pos):
952 def _context_menu_make(self, pos):
General Comments 0
You need to be logged in to leave comments. Login now