File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,6 @@ void SeerCppSourceHighlighter::setHighlighterSettings (const SeerHighlighterSett
75
75
76
76
HighlightingRule rule;
77
77
78
- for (const QString& pattern : keywordPatterns) {
79
-
80
- rule.pattern = QRegularExpression (pattern);
81
- rule.format = _keywordFormat;
82
-
83
- _highlightingRules.append (rule);
84
- }
85
-
86
78
// Set class format and expression.
87
79
rule.pattern = QRegularExpression (QStringLiteral (" \\ bQ[A-Za-z]+\\ b" ));
88
80
rule.format = _classFormat;
@@ -98,6 +90,15 @@ void SeerCppSourceHighlighter::setHighlighterSettings (const SeerHighlighterSett
98
90
rule.format = _functionFormat;
99
91
_highlightingRules.append (rule);
100
92
93
+ // Set keywords format and expression (must have precedence over functions)
94
+ for (const QString& pattern : keywordPatterns) {
95
+
96
+ rule.pattern = QRegularExpression (pattern);
97
+ rule.format = _keywordFormat;
98
+
99
+ _highlightingRules.append (rule);
100
+ }
101
+
101
102
// Set single line comment format and expression.
102
103
rule.pattern = QRegularExpression (QStringLiteral (" //[^\n ]*" ));
103
104
rule.format = _singleLineCommentFormat;
You can’t perform that action at this time.
0 commit comments