forked from qt-creator/qt-creator
QmlJS: improve static initializings
Change-Id: Ifa37c912d0e43bcda896cb0ea851f97566c88d78 Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -42,16 +42,10 @@ QmlJSHighlighter::QmlJSHighlighter(QTextDocument *parent)
|
||||
m_inMultilineComment(false)
|
||||
{
|
||||
m_currentBlockParentheses.reserve(20);
|
||||
static QVector<TextStyle> categories;
|
||||
if (categories.isEmpty()) {
|
||||
categories << C_NUMBER
|
||||
<< C_STRING
|
||||
<< C_TYPE
|
||||
<< C_KEYWORD
|
||||
<< C_FIELD
|
||||
<< C_COMMENT
|
||||
<< C_VISUAL_WHITESPACE;
|
||||
}
|
||||
static const QVector<TextStyle> categories{
|
||||
C_NUMBER, C_STRING, C_TYPE,
|
||||
C_KEYWORD, C_FIELD, C_COMMENT,
|
||||
C_VISUAL_WHITESPACE};
|
||||
setTextFormatCategories(categories);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user