Mark the white spaces using the VisualWhitespace format.

This commit is contained in:
Roberto Raggi
2010-01-29 10:26:33 +01:00
parent d78e64dbf7
commit 4c2c5c02bb

View File

@@ -159,8 +159,14 @@ void QScriptHighlighter::highlightBlock(const QString &text)
++index;
}
int firstNonSpace = 0;
int previousTokenEnd = 0;
for (int i = 0; i < tokens.size(); ++i) {
const Token &token = tokens.at(i);
setFormat(previousTokenEnd, token.begin() - previousTokenEnd, m_formats[VisualWhitespace]);
previousTokenEnd = token.end();
}
int firstNonSpace = 0;
if (! tokens.isEmpty()) {
const Token &tk = tokens.first();
firstNonSpace = tk.offset;