forked from qt-creator/qt-creator
CppEditor: Do not cancel highlighter on user interaction
e.g. changing cursor position or editing text. CPPEditorWidget::updateUses() does not depend on the highlighter, but only on the semantic info update. Task-number: QTCREATORBUG-11367 Change-Id: Ia9f5ed7c2adc6899995a5d966a20e45b2f87d9e3 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -1158,11 +1158,6 @@ void CPPEditorWidget::updateOutlineToolTip()
|
|||||||
|
|
||||||
void CPPEditorWidget::updateUses()
|
void CPPEditorWidget::updateUses()
|
||||||
{
|
{
|
||||||
if (m_highlightWatcher) {
|
|
||||||
m_highlightWatcher->cancel();
|
|
||||||
m_highlightWatcher.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Block premature semantic info calculation when editor is created.
|
// Block premature semantic info calculation when editor is created.
|
||||||
if (m_modelManager && m_modelManager->cppEditorSupport(editor())->initialized())
|
if (m_modelManager && m_modelManager->cppEditorSupport(editor())->initialized())
|
||||||
m_updateUsesTimer->start();
|
m_updateUsesTimer->start();
|
||||||
|
|||||||
@@ -391,10 +391,11 @@ void CppEditorSupport::startHighlighting()
|
|||||||
if (m_lastHighlightRevision == revision)
|
if (m_lastHighlightRevision == revision)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_lastHighlightRevision = revision;
|
m_highlighter.cancel();
|
||||||
static const Document::Ptr dummyDoc;
|
static const Document::Ptr dummyDoc;
|
||||||
static const Snapshot dummySnapshot;
|
static const Snapshot dummySnapshot;
|
||||||
m_highlighter = m_highlightingSupport->highlightingFuture(dummyDoc, dummySnapshot);
|
m_highlighter = m_highlightingSupport->highlightingFuture(dummyDoc, dummySnapshot);
|
||||||
|
m_lastHighlightRevision = revision;
|
||||||
emit highlighterStarted(&m_highlighter, m_lastHighlightRevision);
|
emit highlighterStarted(&m_highlighter, m_lastHighlightRevision);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user