From 8dcb22d5e9d4cee0e05d152d35382bf3ad8e3105 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 6 Oct 2022 13:55:46 +0200 Subject: [PATCH] Editor: fix go to line start Do not try to find the first none space character of a block if we already handled the home key for a line that does not contain the start of the block. Fixes: QTCREATORBUG-28198 Change-Id: Ia2966baeae8f068cd21d716e097782ae3b5a1d86 Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 1b4c0be2b34..aa542763e39 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -6080,6 +6080,7 @@ void TextEditorWidgetPrivate::handleHomeKey(bool anchor, bool block) if (QTextLayout *layout = c.block().layout(); layout->lineForTextPosition(initpos - pos).lineNumber() != 0) { c.movePosition(QTextCursor::StartOfLine, mode); + continue; } }