Skip to content
Snippets Groups Projects
Commit 780abd0d authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Store the document's revision used to compute the warning/error marks.

parent 29c3a674
No related branches found
No related tags found
No related merge requests found
......@@ -1316,6 +1316,7 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc)
}
Editor e;
e.revision = ed->document()->revision();
e.textEditor = textEditor;
e.selections = selections;
e.ifdefedOutBlocks = blockRanges;
......@@ -1340,8 +1341,11 @@ void CppModelManager::updateEditorSelections()
TextEditor::ITextEditor *textEditor = ed.textEditor;
TextEditor::BaseTextEditor *editor = qobject_cast<TextEditor::BaseTextEditor *>(textEditor->widget());
if (! editor)
continue;
else if (editor->document()->revision() != ed.revision)
continue; // outdated
editor->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection,
ed.selections);
......
......@@ -176,6 +176,9 @@ private:
mutable QMutex protectSnapshot;
struct Editor {
Editor()
: revision(-1) {}
int revision;
QPointer<TextEditor::ITextEditor> textEditor;
QList<QTextEdit::ExtraSelection> selections;
QList<TextEditor::BaseTextEditor::BlockRange> ifdefedOutBlocks;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment