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: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-10-06 13:55:46 +02:00
parent 0b04a83ce3
commit 8dcb22d5e9

View File

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