Commit c5f4983b authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Highlight `import' keyword.

parent 14207aa8
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment