aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljseditor/qmljseditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmljseditor/qmljseditor.cpp')
-rw-r--r--src/plugins/qmljseditor/qmljseditor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 4261431953..f2eba64f42 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -635,7 +635,7 @@ QmlJSTextEditorWidget::QmlJSTextEditorWidget(QWidget *parent) :
m_semanticRehighlightTimer = new QTimer(this);
m_semanticRehighlightTimer->setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL);
m_semanticRehighlightTimer->setSingleShot(true);
- connect(m_semanticRehighlightTimer, SIGNAL(timeout()), this, SLOT(forceSemanticRehighlight()));
+ connect(m_semanticRehighlightTimer, SIGNAL(timeout()), this, SLOT(forceSemanticRehighlightIfCurrentEditor()));
connect(this, SIGNAL(textChanged()), this, SLOT(updateDocument()));
@@ -808,6 +808,9 @@ void QmlJSTextEditorWidget::onDocumentUpdated(QmlJS::Document::Ptr doc)
{
if (file()->fileName() != doc->fileName()
|| doc->editorRevision() != document()->revision()) {
+ // maybe a dependency changed: schedule a potential rehighlight
+ // will not rehighlight if the current editor changes away from this file
+ m_semanticRehighlightTimer->start();
return;
}