diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-05-16 12:59:36 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-05-23 09:21:36 +0000 |
commit | 21a246ac385b8d29659e6e3d73c1e44bceb6bd8a (patch) | |
tree | 708e301b1793ca185716af7640fe5bf141c98d58 /src/plugins/cppeditor/cpphighlighter.cpp | |
parent | a901916710e54d3dff8b9224ca278fc1eeb597e4 (diff) |
Fix highlighting of C/C++ line continuation backslashes
The backslash itself is not a token, so we must make sure to only format
the trailing whitespace characters as visual whitespace, instead of
everything trailing.
Broke in a92694596e804b2fc551d82f62d4ab5ab797130b
Task-number: QTCREATORBUG-987
Change-Id: I4e9e84d29513ea317d7e3bde6c6b4c43749cb649
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cpphighlighter.cpp')
-rw-r--r-- | src/plugins/cppeditor/cpphighlighter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index 34af6a5ec4..7d5648646c 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -214,7 +214,7 @@ void CppHighlighter::highlightBlock(const QString &text) // mark the trailing white spaces const int lastTokenEnd = tokens.last().utf16charsEnd(); if (text.length() > lastTokenEnd) - setFormatWithSpaces(text, lastTokenEnd, text.length() - lastTokenEnd, formatForCategory(C_VISUAL_WHITESPACE)); + formatSpaces(text, lastTokenEnd, text.length() - lastTokenEnd); if (!initialLexerState && lexerState && !tokens.isEmpty()) { const Token &lastToken = tokens.last(); |