Skip to content

Commit 5355c65

Browse files
committed
remove comment highlight rule
1 parent 14c787b commit 5355c65

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

highlighter/jsonhighlighter.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ void JsonHighlighter::initKeyWordsRules()
1313
mStringPattern = R"("[A-Za-z0-9_]*"|(?<=:)\s*".*")";
1414
mBoolPattern = R"(\b(true|false)\b)";
1515
mNumberPattern = R"(\b\d+\b)";
16-
mCommentPattern = R"(//.*)";
1716

1817
// init all the format
1918
mStringFormat.setForeground(QColor(0, 200, 0)); // green
@@ -25,14 +24,10 @@ void JsonHighlighter::initKeyWordsRules()
2524
mNumberFormat.setForeground(QColor(0, 0, 200)); // blue
2625
mNumberFormat.setBackground(QColor(255, 255, 255));
2726

28-
mCommentFormat.setForeground(QColor(150, 150, 150)); // gray
29-
mCommentFormat.setBackground(QColor(255, 255, 255));
30-
3127
// gather all the rules
3228
mKeyWordsRules.append(Rule(mStringPattern, mStringFormat));
3329
mKeyWordsRules.append(Rule(mBoolPattern, mBoolFormat));
3430
mKeyWordsRules.append(Rule(mNumberPattern, mNumberFormat));
35-
mKeyWordsRules.append(Rule(mCommentPattern, mCommentFormat));
3631
}
3732

3833
void JsonHighlighter::initSpecialRules()

highlighter/jsonhighlighter.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ class JsonHighlighter : public QSyntaxHighlighter
5151
QString mStringPattern;
5252
QString mBoolPattern;
5353
QString mNumberPattern;
54-
QString mCommentPattern;
5554

5655
QTextCharFormat mStringFormat;
5756
QTextCharFormat mBoolFormat;
5857
QTextCharFormat mNumberFormat;
59-
QTextCharFormat mCommentFormat;
6058

6159
// special rules:
6260
QRegularExpression mColorPattern;

0 commit comments

Comments
 (0)