diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-06-08 12:58:46 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2011-06-08 13:30:47 +0200 |
commit | aee9a55a819971bc9bcddedf8b2c3b489ed9e61d (patch) | |
tree | 1cdb9d76a1a2ecaee46032e4c9d01524610637bc | |
parent | 918a1653da02f712d56bc56c38d235bbf0c41204 (diff) |
QmlJS: Fix missing rehighlight if other file changes.
When QML modules with many source files were loaded, the
rehighlight from the found library was done before the files
contained in the library were done parsing.
This way any updated document will eventually lead to the
current editor rehighlighting.
Reviewed-by: Erik Verbruggen
Change-Id: I0f4d18390d3e0ee17cd255c68496f61479f82f05x
Reviewed-on: http://codereview.qt.nokia.com/382
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
-rw-r--r-- | src/plugins/qmljseditor/qmljseditor.cpp | 5 |
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; } |