Commit 5cb22e50 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppEditor: Fix highlighting in new split if file is changed externally

For a new split/editor no CppHighlightingSupport was set since
onMimeTypeChanged was not called.

Now the CppHighlightingSupport is set again in the constructor. This
reverts partly

    commit 033ad887
    C++: handle file type changes for choosing highlighters

Task-number: QTCREATORBUG-9382
Change-Id: Ie79d357d570bec4920366fbd56fb67859be9b37a
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent ab41da6a
......@@ -115,10 +115,16 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager, BaseTextEditor
, m_cachedContentsEditorRevision(-1)
, m_initialized(false)
, m_lastHighlightRevision(0)
, m_highlightingSupport(modelManager->highlightingSupport(textEditor))
{
connect(m_modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
this, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)));
if (m_highlightingSupport && m_highlightingSupport->requiresSemanticInfo()) {
connect(this, SIGNAL(semanticInfoUpdated(CppTools::SemanticInfo)),
this, SLOT(startHighlighting()));
}
m_updateDocumentTimer = new QTimer(this);
m_updateDocumentTimer->setSingleShot(true);
m_updateDocumentTimer->setInterval(m_updateDocumentInterval);
......@@ -135,6 +141,8 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager, BaseTextEditor
connect(m_textEditor->document(), SIGNAL(mimeTypeChanged()),
this, SLOT(onMimeTypeChanged()));
updateDocument();
}
CppEditorSupport::~CppEditorSupport()
......
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