From 272014a5d0e451652a0a812c27623c6bb5e92cbc Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Fri, 29 Jan 2010 10:50:16 +0100 Subject: [PATCH] Mark the trailing whitespaces. --- src/libs/qmljs/qmljshighlighter.cpp | 8 ++++---- src/plugins/qmljseditor/qmlhighlighter.cpp | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/qmljs/qmljshighlighter.cpp b/src/libs/qmljs/qmljshighlighter.cpp index b994963de77..81dbf34415c 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 e13d7b68ae0..797a3585eca 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"); -- GitLab