diff options
Diffstat (limited to 'src/plugins/git/githighlighters.cpp')
-rw-r--r-- | src/plugins/git/githighlighters.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/plugins/git/githighlighters.cpp b/src/plugins/git/githighlighters.cpp index b86efdc6e4e..4cbb6351378 100644 --- a/src/plugins/git/githighlighters.cpp +++ b/src/plugins/git/githighlighters.cpp @@ -37,9 +37,7 @@ static const char CHANGE_PATTERN[] = "\\b[a-f0-9]{7,40}\\b"; GitSubmitHighlighter::GitSubmitHighlighter(QTextEdit * parent) : TextEditor::SyntaxHighlighter(parent) { - static QVector<TextEditor::TextStyle> categories; - if (categories.isEmpty()) - categories << TextEditor::C_COMMENT; + static const QVector<TextEditor::TextStyle> categories({TextEditor::C_COMMENT}); setTextFormatCategories(categories); m_keywordPattern.setPattern("^[\\w-]+:"); @@ -98,18 +96,17 @@ GitRebaseHighlighter::GitRebaseHighlighter(QTextDocument *parent) : m_hashChar('#'), m_changeNumberPattern(CHANGE_PATTERN) { - static QVector<TextEditor::TextStyle> categories; - if (categories.isEmpty()) { - categories << TextEditor::C_COMMENT - << TextEditor::C_DOXYGEN_COMMENT - << TextEditor::C_STRING - << TextEditor::C_KEYWORD - << TextEditor::C_FIELD - << TextEditor::C_TYPE - << TextEditor::C_ENUMERATION - << TextEditor::C_NUMBER - << TextEditor::C_LABEL; - } + static const QVector<TextEditor::TextStyle> categories({ + TextEditor::C_COMMENT, + TextEditor::C_DOXYGEN_COMMENT, + TextEditor::C_STRING, + TextEditor::C_KEYWORD, + TextEditor::C_FIELD, + TextEditor::C_TYPE, + TextEditor::C_ENUMERATION, + TextEditor::C_NUMBER, + TextEditor::C_LABEL + }); setTextFormatCategories(categories); m_actions << RebaseAction("^(p|pick)\\b", Format_Pick); |