##// END OF EJS Templates
Fixed bugs reported by minrk involving deletion of the input prompt.
epatters -
Show More
@@ -719,6 +719,9 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
719 self.paste()
719 self.paste()
720 intercepted = True
720 intercepted = True
721
721
722 elif key in (QtCore.Qt.Key_Backspace, QtCore.Qt.Key_Delete):
723 intercepted = True
724
722 elif alt_down:
725 elif alt_down:
723 if key == QtCore.Qt.Key_B:
726 if key == QtCore.Qt.Key_B:
724 self._set_cursor(self._get_word_start_cursor(position))
727 self._set_cursor(self._get_word_start_cursor(position))
@@ -740,6 +743,9 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
740 cursor.removeSelectedText()
743 cursor.removeSelectedText()
741 intercepted = True
744 intercepted = True
742
745
746 elif key == QtCore.Qt.Key_Delete:
747 intercepted = True
748
743 elif key == QtCore.Qt.Key_Greater:
749 elif key == QtCore.Qt.Key_Greater:
744 self._control.moveCursor(QtGui.QTextCursor.End)
750 self._control.moveCursor(QtGui.QTextCursor.End)
745 intercepted = True
751 intercepted = True
@@ -831,10 +837,10 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
831 elif key == QtCore.Qt.Key_Backspace:
837 elif key == QtCore.Qt.Key_Backspace:
832
838
833 # Line deletion (remove continuation prompt)
839 # Line deletion (remove continuation prompt)
834 len_prompt = len(self._continuation_prompt)
840 line, col = cursor.blockNumber(), cursor.columnNumber()
835 if not self._reading and \
841 if not self._reading and \
836 cursor.columnNumber() == len_prompt and \
842 col == len(self._continuation_prompt) and \
837 position != self._prompt_pos:
843 line > self._get_prompt_cursor().blockNumber():
838 cursor.beginEditBlock()
844 cursor.beginEditBlock()
839 cursor.movePosition(QtGui.QTextCursor.StartOfBlock,
845 cursor.movePosition(QtGui.QTextCursor.StartOfBlock,
840 QtGui.QTextCursor.KeepAnchor)
846 QtGui.QTextCursor.KeepAnchor)
@@ -854,8 +860,8 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
854 elif key == QtCore.Qt.Key_Delete:
860 elif key == QtCore.Qt.Key_Delete:
855
861
856 # Line deletion (remove continuation prompt)
862 # Line deletion (remove continuation prompt)
857 if not self._reading and cursor.atBlockEnd() and not \
863 if not self._reading and self._in_buffer(position) and \
858 cursor.hasSelection():
864 cursor.atBlockEnd() and not cursor.hasSelection():
859 cursor.movePosition(QtGui.QTextCursor.NextBlock,
865 cursor.movePosition(QtGui.QTextCursor.NextBlock,
860 QtGui.QTextCursor.KeepAnchor)
866 QtGui.QTextCursor.KeepAnchor)
861 cursor.movePosition(QtGui.QTextCursor.Right,
867 cursor.movePosition(QtGui.QTextCursor.Right,
General Comments 0
You need to be logged in to leave comments. Login now