TextEditor: reuse resetReloadMarks in documentReloaded

Change-Id: I41721e8c08fa70bf713154d7096753e0f49afb8c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2023-04-13 14:07:21 +02:00
parent 9650a2bded
commit b1415a0ea5

View File

@@ -674,8 +674,9 @@ void TextDocumentLayout::documentAboutToReload()
void TextDocumentLayout::documentReloaded(TextDocument *baseTextDocument)
{
for (TextMark *mark : std::as_const(m_reloadMarks)) {
mark->setDeleteCallback({});
const TextMarks marks = m_reloadMarks;
resetReloadMarks();
for (TextMark *mark : marks) {
int blockNumber = mark->lineNumber() - 1;
QTextBlock block = document()->findBlockByNumber(blockNumber);
if (block.isValid()) {
@@ -689,7 +690,6 @@ void TextDocumentLayout::documentReloaded(TextDocument *baseTextDocument)
mark->removedFromEditor();
}
}
m_reloadMarks.clear();
requestUpdate();
}