##// END OF EJS Templates
The Left and Right arrow keys now traverse the input buffer as expected.
epatters -
Show More
@@ -922,7 +922,27 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
922 922 intercepted = not self._tab_pressed()
923 923
924 924 elif key == QtCore.Qt.Key_Left:
925 intercepted = not self._in_buffer(position - 1)
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:
936 intercepted = not self._in_buffer(position - 1)
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
926 946
927 947 elif key == QtCore.Qt.Key_Home:
928 948 start_line = cursor.blockNumber()
General Comments 0
You need to be logged in to leave comments. Login now