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

Postpone the update of the ifdefedOut blocks.

parent fcf4d6fd
No related branches found
No related tags found
No related merge requests found
...@@ -760,7 +760,6 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc) ...@@ -760,7 +760,6 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc)
foreach (const Document::Block &block, doc->skippedBlocks()) { foreach (const Document::Block &block, doc->skippedBlocks()) {
blockRanges.append(TextEditor::BaseTextEditor::BlockRange(block.begin(), block.end())); blockRanges.append(TextEditor::BaseTextEditor::BlockRange(block.begin(), block.end()));
} }
ed->setIfdefedOutBlocks(blockRanges);
QList<QTextEdit::ExtraSelection> selections; QList<QTextEdit::ExtraSelection> selections;
...@@ -827,6 +826,7 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc) ...@@ -827,6 +826,7 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc)
Editor e; Editor e;
e.widget = ed; e.widget = ed;
e.selections = selections; e.selections = selections;
e.ifdefedOutBlocks = blockRanges;
todo.append(e); todo.append(e);
m_todo = todo; m_todo = todo;
postEditorUpdate(); postEditorUpdate();
...@@ -848,6 +848,8 @@ void CppModelManager::updateEditorSelections() ...@@ -848,6 +848,8 @@ void CppModelManager::updateEditorSelections()
ed.widget->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection, ed.widget->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection,
ed.selections); ed.selections);
ed.widget->setIfdefedOutBlocks(ed.ifdefedOutBlocks);
} }
m_todo.clear(); m_todo.clear();
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <cplusplus/CppDocument.h> #include <cplusplus/CppDocument.h>
#include <texteditor/basetexteditor.h>
#include <QMap> #include <QMap>
#include <QFutureInterface> #include <QFutureInterface>
#include <QMutex> #include <QMutex>
...@@ -171,6 +173,7 @@ private: ...@@ -171,6 +173,7 @@ private:
struct Editor { struct Editor {
QPointer<TextEditor::BaseTextEditor> widget; QPointer<TextEditor::BaseTextEditor> widget;
QList<QTextEdit::ExtraSelection> selections; QList<QTextEdit::ExtraSelection> selections;
QList<TextEditor::BaseTextEditor::BlockRange> ifdefedOutBlocks;
}; };
QList<Editor> m_todo; QList<Editor> m_todo;
......
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