Show More
@@ -922,8 +922,28 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||||
922 | intercepted = not self._tab_pressed() |
|
922 | intercepted = not self._tab_pressed() | |
923 |
|
923 | |||
924 | elif key == QtCore.Qt.Key_Left: |
|
924 | elif key == QtCore.Qt.Key_Left: | |
|
925 | ||||
|
926 | # Move to the previous line | |||
|
927 | line, col = cursor.blockNumber(), cursor.columnNumber() | |||
|
928 | if line > self._get_prompt_cursor().blockNumber() and \ | |||
|
929 | col == len(self._continuation_prompt): | |||
|
930 | self._control.moveCursor(QtGui.QTextCursor.PreviousBlock) | |||
|
931 | self._control.moveCursor(QtGui.QTextCursor.EndOfBlock) | |||
|
932 | intercepted = True | |||
|
933 | ||||
|
934 | # Regular left movement | |||
|
935 | else: | |||
925 | intercepted = not self._in_buffer(position - 1) |
|
936 | intercepted = not self._in_buffer(position - 1) | |
926 |
|
937 | |||
|
938 | elif key == QtCore.Qt.Key_Right: | |||
|
939 | original_block_number = cursor.blockNumber() | |||
|
940 | cursor.movePosition(QtGui.QTextCursor.Right) | |||
|
941 | if cursor.blockNumber() != original_block_number: | |||
|
942 | cursor.movePosition(QtGui.QTextCursor.Right, | |||
|
943 | n=len(self._continuation_prompt)) | |||
|
944 | self._set_cursor(cursor) | |||
|
945 | intercepted = True | |||
|
946 | ||||
927 | elif key == QtCore.Qt.Key_Home: |
|
947 | elif key == QtCore.Qt.Key_Home: | |
928 | start_line = cursor.blockNumber() |
|
948 | start_line = cursor.blockNumber() | |
929 | if start_line == self._get_prompt_cursor().blockNumber(): |
|
949 | if start_line == self._get_prompt_cursor().blockNumber(): |
General Comments 0
You need to be logged in to leave comments.
Login now