TextEditor: Jump over braces inserted by the TextDocumentManipulator

Task-number: QTCREATORBUG-16946
Change-Id: I445c5698da59230f1d6ae859e6bbf20d26fc5bb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
David Schulz
2017-07-17 14:32:59 +02:00
committed by Orgad Shaneh
parent 66f762959e
commit 1ebc364349

View File

@@ -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);
}