aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cpphighlighter.cpp
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-08-22 17:25:12 +0200
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-09-13 11:15:05 +0000
commit50e5aacb026e79995c9967b12eabb9d37336a841 (patch)
tree13fec0e3b67bd9197c887ad0a9a61ec520bfc50f /src/plugins/cppeditor/cpphighlighter.cpp
parentccf2d848f4514428bbfe1702e43b20dcb77f58e8 (diff)
Highlighting: Add highlighting style for punctuation
Currently only operators have their own style but not punctuation tokens. Make possible to highlight both. Task-number: QTCREATORBUG-20666 Change-Id: I9533e0f1bef65b86c4e4f5c9756571103584124b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cpphighlighter.cpp')
-rw-r--r--src/plugins/cppeditor/cpphighlighter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp
index 7d5648646c..075791b021 100644
--- a/src/plugins/cppeditor/cpphighlighter.cpp
+++ b/src/plugins/cppeditor/cpphighlighter.cpp
@@ -203,6 +203,8 @@ void CppHighlighter::highlightBlock(const QString &text)
formatForCategory(C_PRIMITIVE_TYPE));
} else if (tk.isOperator()) {
setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_OPERATOR));
+ } else if (tk.isPunctuation()) {
+ setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_PUNCTUATION));
} else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) {
setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_LABEL));
} else if (tk.is(T_IDENTIFIER)) {