forked from qt-creator/qt-creator
TextEditor: Fix jump to a search result to a folded block
Change-Id: Id9963bdf2a02930911753af046443e9b657bc9b9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -3552,6 +3552,7 @@ void TextEditorWidget::restoreState(const QByteArray &state)
|
|||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
documentLayout->requestUpdate();
|
documentLayout->requestUpdate();
|
||||||
documentLayout->emitDocumentSizeChanged();
|
documentLayout->emitDocumentSizeChanged();
|
||||||
|
d->updateCursorPosition();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (!singleShotAfterHighlightingDone(foldingRestore))
|
if (!singleShotAfterHighlightingDone(foldingRestore))
|
||||||
@@ -6696,6 +6697,9 @@ void TextEditorWidget::ensureBlockIsUnfolded(QTextBlock block)
|
|||||||
|
|
||||||
void TextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block)
|
void TextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
|
if (q->singleShotAfterHighlightingDone([this, block] { toggleBlockVisible(block); }))
|
||||||
|
return;
|
||||||
|
|
||||||
auto documentLayout = qobject_cast<TextDocumentLayout*>(q->document()->documentLayout());
|
auto documentLayout = qobject_cast<TextDocumentLayout*>(q->document()->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user