From a1cc9b4e5c65415242211a7ea62a5bb17fef5676 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 10 Feb 2022 08:26:19 +0100 Subject: [PATCH] Editor: fix internal cursor position after backspace Fixes: QTCREATORBUG-27035 Change-Id: Id39d8832c5e3327cd42ce10447da98ca78fe476d Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 731c5ba779e..fd814163a72 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -5889,7 +5889,7 @@ void TextEditorWidgetPrivate::handleBackspaceKey() QTC_ASSERT(!q->multiTextCursor().hasSelection(), return); MultiTextCursor cursor = m_cursors; cursor.beginEditBlock(); - for (QTextCursor c : cursor) { + for (QTextCursor &c : cursor) { const int pos = c.position(); if (!pos) continue;