forked from qt-creator/qt-creator
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:
@@ -6080,6 +6080,7 @@ void TextEditorWidgetPrivate::handleHomeKey(bool anchor, bool block)
|
|||||||
if (QTextLayout *layout = c.block().layout();
|
if (QTextLayout *layout = c.block().layout();
|
||||||
layout->lineForTextPosition(initpos - pos).lineNumber() != 0) {
|
layout->lineForTextPosition(initpos - pos).lineNumber() != 0) {
|
||||||
c.movePosition(QTextCursor::StartOfLine, mode);
|
c.movePosition(QTextCursor::StartOfLine, mode);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user