Postpone the update of the ifdefedOut blocks.

This commit is contained in:
Roberto Raggi
2009-02-23 17:49:03 +01:00
parent fcf4d6fd14
commit 65ff19e7fa
2 changed files with 6 additions and 1 deletions

View File

@@ -760,7 +760,6 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc)
foreach (const Document::Block &block, doc->skippedBlocks()) {
blockRanges.append(TextEditor::BaseTextEditor::BlockRange(block.begin(), block.end()));
}
ed->setIfdefedOutBlocks(blockRanges);
QList<QTextEdit::ExtraSelection> selections;
@@ -827,6 +826,7 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc)
Editor e;
e.widget = ed;
e.selections = selections;
e.ifdefedOutBlocks = blockRanges;
todo.append(e);
m_todo = todo;
postEditorUpdate();
@@ -848,6 +848,8 @@ void CppModelManager::updateEditorSelections()
ed.widget->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection,
ed.selections);
ed.widget->setIfdefedOutBlocks(ed.ifdefedOutBlocks);
}
m_todo.clear();

View File

@@ -38,6 +38,8 @@
#include <projectexplorer/project.h>
#include <cplusplus/CppDocument.h>
#include <texteditor/basetexteditor.h>
#include <QMap>
#include <QFutureInterface>
#include <QMutex>
@@ -171,6 +173,7 @@ private:
struct Editor {
QPointer<TextEditor::BaseTextEditor> widget;
QList<QTextEdit::ExtraSelection> selections;
QList<TextEditor::BaseTextEditor::BlockRange> ifdefedOutBlocks;
};
QList<Editor> m_todo;