forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user