diff options
Diffstat (limited to 'src/plugins/texteditor/texteditor.cpp')
-rw-r--r-- | src/plugins/texteditor/texteditor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 7e8c1c2345..ba1dd248bd 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -7431,7 +7431,10 @@ void TextEditorWidget::keepAutoCompletionHighlight(bool keepHighlight) void TextEditorWidget::setAutoCompleteSkipPosition(const QTextCursor &cursor) { QTextCursor tc = cursor; - tc.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); + // Create a selection of the next character but keep the current position, otherwise + // the cursor would be removed from the list of automatically inserted text positions + tc.movePosition(QTextCursor::NextCharacter); + tc.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); d->autocompleterHighlight(tc); } |