diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index eb743965b41368a69df4622809754118a901a1ce..00b240f77954bf4c9150b6f96bea7ac0a29fa124 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1158,11 +1158,6 @@ void CPPEditorWidget::updateOutlineToolTip() void CPPEditorWidget::updateUses() { - if (m_highlightWatcher) { - m_highlightWatcher->cancel(); - m_highlightWatcher.reset(); - } - // Block premature semantic info calculation when editor is created. if (m_modelManager && m_modelManager->cppEditorSupport(editor())->initialized()) m_updateUsesTimer->start(); diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index 664d6761a532690a43a113dd69c83ef1ea3e6dd8..084f4822e92f7a277033717b3445740e49700087 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -391,10 +391,11 @@ void CppEditorSupport::startHighlighting() if (m_lastHighlightRevision == revision) return; - m_lastHighlightRevision = revision; + m_highlighter.cancel(); static const Document::Ptr dummyDoc; static const Snapshot dummySnapshot; m_highlighter = m_highlightingSupport->highlightingFuture(dummyDoc, dummySnapshot); + m_lastHighlightRevision = revision; emit highlighterStarted(&m_highlighter, m_lastHighlightRevision); } }