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/texteditor/syntaxhighlighter.h | |
parent | a901916710e54d3dff8b9224ca278fc1eeb597e4 (diff) | |
download | qt-creator-21a246ac385b8d29659e6e3d73c1e44bceb6bd8a.tar.gz |
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/texteditor/syntaxhighlighter.h')
-rw-r--r-- | src/plugins/texteditor/syntaxhighlighter.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/texteditor/syntaxhighlighter.h b/src/plugins/texteditor/syntaxhighlighter.h index 734a35b2b3..cb41dc9668 100644 --- a/src/plugins/texteditor/syntaxhighlighter.h +++ b/src/plugins/texteditor/syntaxhighlighter.h @@ -33,6 +33,7 @@ #include <QTextLayout> #include <functional> +#include <limits.h> QT_BEGIN_NAMESPACE class QTextDocument; @@ -84,7 +85,7 @@ protected: void setFormat(int start, int count, const QFont &font); QTextCharFormat format(int pos) const; - void formatSpaces(const QString &text); + void formatSpaces(const QString &text, int start = 0, int count = INT_MAX); void setFormatWithSpaces(const QString &text, int start, int count, const QTextCharFormat &format); |