##// END OF EJS Templates
Added Ctrl+H and Ctrl+U shortcuts to Qt console....
epatters -
Show More
@@ -109,6 +109,7 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
109 109 QtCore.Qt.Key_A : QtCore.Qt.Key_Home,
110 110 QtCore.Qt.Key_P : QtCore.Qt.Key_Up,
111 111 QtCore.Qt.Key_N : QtCore.Qt.Key_Down,
112 QtCore.Qt.Key_H : QtCore.Qt.Key_Backspace,
112 113 QtCore.Qt.Key_D : QtCore.Qt.Key_Delete, }
113 114 if not sys.platform == 'darwin':
114 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 964 self._page_control.setFocus()
964 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 981 elif key == QtCore.Qt.Key_Y:
967 982 self.paste()
968 983 intercepted = True
@@ -1016,9 +1031,9 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
1016 1031
1017 1032 else:
1018 1033 if shift_down:
1019 anchormode=QtGui.QTextCursor.KeepAnchor
1034 anchormode = QtGui.QTextCursor.KeepAnchor
1020 1035 else:
1021 anchormode=QtGui.QTextCursor.MoveAnchor
1036 anchormode = QtGui.QTextCursor.MoveAnchor
1022 1037
1023 1038 if key == QtCore.Qt.Key_Escape:
1024 1039 self._keyboard_quit()
@@ -1049,9 +1064,9 b' class ConsoleWidget(Configurable, QtGui.QWidget):'
1049 1064 if line > self._get_prompt_cursor().blockNumber() and \
1050 1065 col == len(self._continuation_prompt):
1051 1066 self._control.moveCursor(QtGui.QTextCursor.PreviousBlock,
1052 mode=anchormode)
1067 mode=anchormode)
1053 1068 self._control.moveCursor(QtGui.QTextCursor.EndOfBlock,
1054 mode=anchormode)
1069 mode=anchormode)
1055 1070 intercepted = True
1056 1071
1057 1072 # Regular left movement
General Comments 0
You need to be logged in to leave comments. Login now