Fixes the warning in incrementalApplyExtraAdditionalFormats being
triggered when the document is reduced in size while a highlight is
running.
Change-Id: I60e0c8772d511f52ee433d27cc77ba726030b354
Reviewed-on: http://codereview.qt-project.org/4661
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
void QmlJSTextEditorWidget::updateUses()
{
+ if (m_semanticHighlighter->startRevision() != editorRevision())
+ m_semanticHighlighter->cancel();
m_updateUsesTimer->start();
}
m_watcher.setFuture(f);
}
+void SemanticHighlighter::cancel()
+{
+ m_watcher.cancel();
+}
+
void SemanticHighlighter::applyResults(int from, int to)
{
if (m_watcher.isCanceled())
m_formats[LocalStateNameType] = fontSettings.toTextCharFormat(QLatin1String(TextEditor::Constants::C_QML_STATE_NAME));
}
+int SemanticHighlighter::startRevision() const
+{
+ return m_startRevision;
+}
SemanticHighlighter(QmlJSTextEditorWidget *editor);
void rerun(const QmlJS::ScopeChain &scopeChain);
+ void cancel();
+
+ int startRevision() const;
void updateFontSettings(const TextEditor::FontSettings &fontSettings);