Show More
@@ -109,6 +109,7 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||||
109 | QtCore.Qt.Key_A : QtCore.Qt.Key_Home, |
|
109 | QtCore.Qt.Key_A : QtCore.Qt.Key_Home, | |
110 | QtCore.Qt.Key_P : QtCore.Qt.Key_Up, |
|
110 | QtCore.Qt.Key_P : QtCore.Qt.Key_Up, | |
111 | QtCore.Qt.Key_N : QtCore.Qt.Key_Down, |
|
111 | QtCore.Qt.Key_N : QtCore.Qt.Key_Down, | |
|
112 | QtCore.Qt.Key_H : QtCore.Qt.Key_Backspace, | |||
112 | QtCore.Qt.Key_D : QtCore.Qt.Key_Delete, } |
|
113 | QtCore.Qt.Key_D : QtCore.Qt.Key_Delete, } | |
113 | if not sys.platform == 'darwin': |
|
114 | if not sys.platform == 'darwin': | |
114 | # On OS X, Ctrl-E already does the right thing, whereas End moves the |
|
115 | # On OS X, Ctrl-E already does the right thing, whereas End moves the | |
@@ -963,6 +964,20 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||||
963 | self._page_control.setFocus() |
|
964 | self._page_control.setFocus() | |
964 | intercepted = True |
|
965 | intercepted = True | |
965 |
|
966 | |||
|
967 | elif key == QtCore.Qt.Key_U: | |||
|
968 | if self._in_buffer(position): | |||
|
969 | start_line = cursor.blockNumber() | |||
|
970 | if start_line == self._get_prompt_cursor().blockNumber(): | |||
|
971 | offset = len(self._prompt) | |||
|
972 | else: | |||
|
973 | offset = len(self._continuation_prompt) | |||
|
974 | cursor.movePosition(QtGui.QTextCursor.StartOfBlock, | |||
|
975 | QtGui.QTextCursor.KeepAnchor) | |||
|
976 | cursor.movePosition(QtGui.QTextCursor.Right, | |||
|
977 | QtGui.QTextCursor.KeepAnchor, offset) | |||
|
978 | cursor.removeSelectedText() | |||
|
979 | intercepted = True | |||
|
980 | ||||
966 | elif key == QtCore.Qt.Key_Y: |
|
981 | elif key == QtCore.Qt.Key_Y: | |
967 | self.paste() |
|
982 | self.paste() | |
968 | intercepted = True |
|
983 | intercepted = True | |
@@ -1016,9 +1031,9 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||||
1016 |
|
1031 | |||
1017 | else: |
|
1032 | else: | |
1018 | if shift_down: |
|
1033 | if shift_down: | |
1019 | anchormode=QtGui.QTextCursor.KeepAnchor |
|
1034 | anchormode = QtGui.QTextCursor.KeepAnchor | |
1020 | else: |
|
1035 | else: | |
1021 | anchormode=QtGui.QTextCursor.MoveAnchor |
|
1036 | anchormode = QtGui.QTextCursor.MoveAnchor | |
1022 |
|
1037 | |||
1023 | if key == QtCore.Qt.Key_Escape: |
|
1038 | if key == QtCore.Qt.Key_Escape: | |
1024 | self._keyboard_quit() |
|
1039 | self._keyboard_quit() | |
@@ -1049,9 +1064,9 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||||
1049 | if line > self._get_prompt_cursor().blockNumber() and \ |
|
1064 | if line > self._get_prompt_cursor().blockNumber() and \ | |
1050 | col == len(self._continuation_prompt): |
|
1065 | col == len(self._continuation_prompt): | |
1051 | self._control.moveCursor(QtGui.QTextCursor.PreviousBlock, |
|
1066 | self._control.moveCursor(QtGui.QTextCursor.PreviousBlock, | |
1052 | mode=anchormode) |
|
1067 | mode=anchormode) | |
1053 | self._control.moveCursor(QtGui.QTextCursor.EndOfBlock, |
|
1068 | self._control.moveCursor(QtGui.QTextCursor.EndOfBlock, | |
1054 | mode=anchormode) |
|
1069 | mode=anchormode) | |
1055 | intercepted = True |
|
1070 | intercepted = True | |
1056 |
|
1071 | |||
1057 | # Regular left movement |
|
1072 | # Regular left movement |
General Comments 0
You need to be logged in to leave comments.
Login now