diff --git a/src/libs/qmljs/qmljshighlighter.cpp b/src/libs/qmljs/qmljshighlighter.cpp index b994963de7726fe5697a9f2ca62fc097db8c257a..81dbf34415c27f7a8da45081e0c7c237fa53d353 100644 --- a/src/libs/qmljs/qmljshighlighter.cpp +++ b/src/libs/qmljs/qmljshighlighter.cpp @@ -189,11 +189,11 @@ void QScriptHighlighter::highlightBlock(const QString &text) previousTokenEnd = token.end(); } + setFormat(previousTokenEnd, text.length() - previousTokenEnd, m_formats[VisualWhitespace]); + int firstNonSpace = 0; - if (! tokens.isEmpty()) { - const Token &tk = tokens.first(); - firstNonSpace = tk.offset; - } + if (! tokens.isEmpty()) + firstNonSpace = tokens.first().offset; setCurrentBlockState(m_scanner.endState()); onBlockEnd(m_scanner.endState(), firstNonSpace); diff --git a/src/plugins/qmljseditor/qmlhighlighter.cpp b/src/plugins/qmljseditor/qmlhighlighter.cpp index e13d7b68ae089138763ed896d3a12599c68e8ed6..797a3585ecaaf810e11225654969d8a956699748 100644 --- a/src/plugins/qmljseditor/qmlhighlighter.cpp +++ b/src/plugins/qmljseditor/qmlhighlighter.cpp @@ -41,6 +41,7 @@ QmlHighlighter::QmlHighlighter(QTextDocument *parent) : m_braceDepth = 0; QSet<QString> qmlKeywords(keywords()); + qmlKeywords << QLatin1String("alias"); qmlKeywords << QLatin1String("property"); qmlKeywords << QLatin1String("signal"); qmlKeywords << QLatin1String("readonly");