diff options
Diffstat (limited to 'objects/basetexteditor.cpp')
-rw-r--r-- | objects/basetexteditor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/objects/basetexteditor.cpp b/objects/basetexteditor.cpp index 747b20e..67fdda5 100644 --- a/objects/basetexteditor.cpp +++ b/objects/basetexteditor.cpp @@ -487,6 +487,20 @@ bool BaseTextEditor::findRegexp(const QString ®exp, bool backward, bool caseS return true; } +void BaseTextEditor::deleteRegion(const Position &from, const Position &to) +{ + QPointer<Mark> start = createMark(); + gotoPosition(from); + int fromPos = nativePosition(); + gotoPosition(to); + int toPos = nativePosition(); + QTextCursor cursor( textEditorWidget()->document()); + cursor.setPosition(fromPos); + cursor.setPosition(toPos, QTextCursor::KeepAnchor); + cursor.removeSelectedText(); + gotoMark(start); +} + void BaseTextEditor::indent() { if (textEditorWidget()) |