From c5f4983b0c40c0a6b477461aecf1c185df9f8a75 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 29 Jan 2010 11:23:06 +0100 Subject: [PATCH] Highlight `import' keyword. --- src/libs/qmljs/qmljshighlighter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/qmljs/qmljshighlighter.cpp b/src/libs/qmljs/qmljshighlighter.cpp index 81c01d2b330..cf92815965b 100644 --- a/src/libs/qmljs/qmljshighlighter.cpp +++ b/src/libs/qmljs/qmljshighlighter.cpp @@ -115,7 +115,7 @@ void QScriptHighlighter::highlightBlock(const QString &text) break; case Token::Identifier: { - if (maybeQmlKeyword(text.midRef(token.offset, token.length))) { + if (m_duiEnabled && maybeQmlKeyword(text.midRef(token.offset, token.length))) { // check the previous token if (index == 0 || tokens.at(index - 1).isNot(Token::Dot)) { if (index + 1 == tokens.size() || tokens.at(index + 1).isNot(Token::Colon)) { @@ -241,6 +241,8 @@ bool QScriptHighlighter::maybeQmlKeyword(const QStringRef &text) const return true; } else if (ch == QLatin1Char('r') && text == QLatin1String("readonly")) { return true; + } else if (ch == QLatin1Char('i') && text == QLatin1String("import")) { + return true; } else { return false; }