diff --git a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc index f333c92bc42..89c6670e7e0 100644 --- a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc +++ b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc @@ -153,9 +153,14 @@ \section1 Column Editing - To apply a change to several rows in a column simultaneously, press - \key Alt, select the rows, and enter or remove text. The changes are made - simultaneously at the cursor position on all the selected rows. + To apply a change to several rows in a column simultaneously, hold + \key Alt, select the rows using the mouse, and enter or remove text. + The changes are made simultaneously at the cursor position on all the + selected rows. + + On Windows and Linux, you can also hold \key {Alt+Shift} and select + the rows using the arrow keys and the \key PageUp, \key PageDown, + \key Home, \key End keys. \section1 Applying Refactoring Actions diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index dd0e31e65a3..ae4ac073b61 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -2496,6 +2496,10 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e) case Qt::Key_Down: case Qt::Key_Right: case Qt::Key_Left: + case Qt::Key_PageUp: + case Qt::Key_PageDown: + case Qt::Key_Home: + case Qt::Key_End: if (HostOsInfo::isMacHost()) break; if ((e->modifiers() @@ -2518,6 +2522,22 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e) case Qt::Key_Right: ++d->m_blockSelection.positionColumn; break; + case Qt::Key_PageUp: + d->m_blockSelection.positionBlock -= verticalScrollBar()->pageStep(); + if (d->m_blockSelection.positionBlock < 0) + d->m_blockSelection.positionBlock = 0; + break; + case Qt::Key_PageDown: + d->m_blockSelection.positionBlock += verticalScrollBar()->pageStep(); + if (d->m_blockSelection.positionBlock > document()->blockCount() - 1) + d->m_blockSelection.positionBlock = document()->blockCount() - 1; + break; + case Qt::Key_Home: + d->m_blockSelection.positionBlock = 0; + break; + case Qt::Key_End: + d->m_blockSelection.positionBlock = document()->blockCount() - 1; + break; default: break; }