diff --git a/src/widgets/helper/ResizingTextEdit.cpp b/src/widgets/helper/ResizingTextEdit.cpp index d0ed7a93..59e9f09e 100644 --- a/src/widgets/helper/ResizingTextEdit.cpp +++ b/src/widgets/helper/ResizingTextEdit.cpp @@ -291,8 +291,8 @@ void ResizingTextEdit::insertCompletion(const QString &completion) } QTextCursor tc = this->textCursor(); - tc.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, - prefixSize); + int completionStart = tc.position() - prefixSize; + tc.setPosition(completionStart, QTextCursor::KeepAnchor); tc.insertText(completion); this->setTextCursor(tc); this->updateGeometry();