Commit 780abd0d authored by Roberto Raggi's avatar Roberto Raggi

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

parent 29c3a674
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment