forked from qt-creator/qt-creator
TextEditor: reuse resetReloadMarks in documentReloaded
Change-Id: I41721e8c08fa70bf713154d7096753e0f49afb8c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -674,8 +674,9 @@ void TextDocumentLayout::documentAboutToReload()
|
|||||||
|
|
||||||
void TextDocumentLayout::documentReloaded(TextDocument *baseTextDocument)
|
void TextDocumentLayout::documentReloaded(TextDocument *baseTextDocument)
|
||||||
{
|
{
|
||||||
for (TextMark *mark : std::as_const(m_reloadMarks)) {
|
const TextMarks marks = m_reloadMarks;
|
||||||
mark->setDeleteCallback({});
|
resetReloadMarks();
|
||||||
|
for (TextMark *mark : marks) {
|
||||||
int blockNumber = mark->lineNumber() - 1;
|
int blockNumber = mark->lineNumber() - 1;
|
||||||
QTextBlock block = document()->findBlockByNumber(blockNumber);
|
QTextBlock block = document()->findBlockByNumber(blockNumber);
|
||||||
if (block.isValid()) {
|
if (block.isValid()) {
|
||||||
@@ -689,7 +690,6 @@ void TextDocumentLayout::documentReloaded(TextDocument *baseTextDocument)
|
|||||||
mark->removedFromEditor();
|
mark->removedFromEditor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_reloadMarks.clear();
|
|
||||||
requestUpdate();
|
requestUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user