forked from qt-creator/qt-creator
Terminal: Support Alt+Left / Alt+Right cursor move
Fixes: QTCREATORBUG-28941 Change-Id: I7c8e012733f6dcb2851e8e1b840d53317e413cd8 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -234,6 +234,8 @@ void TerminalWidget::setupActions()
|
||||
connect(&a.paste, &QAction::triggered, this, ifHasFocus(&TerminalWidget::pasteFromClipboard));
|
||||
connect(&a.clearSelection, &QAction::triggered, this, ifHasFocus(&TerminalWidget::clearSelection));
|
||||
connect(&a.clearTerminal, &QAction::triggered, this, ifHasFocus(&TerminalWidget::clearContents));
|
||||
connect(&a.moveCursorWordLeft, &QAction::triggered, this, ifHasFocus(&TerminalWidget::moveCursorWordLeft));
|
||||
connect(&a.moveCursorWordRight, &QAction::triggered, this, ifHasFocus(&TerminalWidget::moveCursorWordRight));
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
@@ -402,6 +404,16 @@ void TerminalWidget::zoomOut()
|
||||
setFont(m_font);
|
||||
}
|
||||
|
||||
void TerminalWidget::moveCursorWordLeft()
|
||||
{
|
||||
writeToPty("\x1b\x62");
|
||||
}
|
||||
|
||||
void TerminalWidget::moveCursorWordRight()
|
||||
{
|
||||
writeToPty("\x1b\x66");
|
||||
}
|
||||
|
||||
void TerminalWidget::clearContents()
|
||||
{
|
||||
m_surface->clearAll();
|
||||
|
||||
Reference in New Issue
Block a user