diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 53ffdea928bc3382ffd2685da4c0773014713245..87062a84b5cdae0be04c726ef8a86ef3f15c2adf 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -5786,6 +5786,21 @@ bool BaseTextEditor::inFindScope(int selectionStart, int selectionEnd) return true; } +void BaseTextEditor::setBlockSelection(bool on) +{ + if (d->m_inBlockSelectionMode != on) { + d->m_inBlockSelectionMode = on; + if (on) + d->m_blockSelection.fromSelection(tabSettings(), textCursor()); + viewport()->update(); + } +} + +bool BaseTextEditor::hasBlockSelection() const +{ + return d->m_inBlockSelectionMode; +} + void BaseTextEditor::handleBlockSelection(int diff_row, int diff_col) { diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 176350502fdf625c87426a863da92cdbd629ef8b..423dff62ae2f30ff96fbb5e35d7ea68da8aad391 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -237,6 +237,8 @@ public: void insertCodeSnippet(const QTextCursor &cursor, const QString &snippet); + void setBlockSelection(bool on); + bool hasBlockSelection() const; int verticalBlockSelectionFirstColumn() const; int verticalBlockSelectionLastColumn() const;