ProFileHighlighter::ProFileHighlighter(const Keywords &keywords) : m_keywords(keywords) { static QVector<TextStyle> categories; if (categories.isEmpty()) categories << C_TYPE << C_KEYWORD << C_COMMENT << C_VISUAL_WHITESPACE; setTextFormatCategories(categories); }
MercurialSubmitHighlighter::MercurialSubmitHighlighter(QTextEdit *parent) : TextEditor::SyntaxHighlighter(parent), m_keywordPattern(QLatin1String("^\\w+:")) { static QVector<TextEditor::TextStyle> categories; if (categories.isEmpty()) categories << TextEditor::C_COMMENT; setTextFormatCategories(categories); QTC_CHECK(m_keywordPattern.isValid()); }
// --- DiffHighlighter DiffHighlighter::DiffHighlighter(const QRegExp &filePattern) : TextEditor::SyntaxHighlighter(static_cast<QTextDocument *>(0)), d_ptr(new DiffHighlighterPrivate(filePattern)) { d_ptr->q_ptr = this; Q_D(DiffHighlighter); static QVector<TextEditor::TextStyle> categories; if (categories.isEmpty()) { categories << TextEditor::C_TEXT << TextEditor::C_ADDED_LINE << TextEditor::C_REMOVED_LINE << TextEditor::C_DIFF_FILE << TextEditor::C_DIFF_LOCATION; } setTextFormatCategories(categories); d->updateOtherFormats(); }
BaseAnnotationHighlighter::BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) : TextEditor::SyntaxHighlighter(document), d_ptr(new BaseAnnotationHighlighterPrivate()) { d_ptr->q_ptr = this; Q_D(BaseAnnotationHighlighter); static QVector<TextEditor::TextStyle> categories; if (categories.isEmpty()) categories << TextEditor::C_TEXT; setTextFormatCategories(categories); d->updateOtherFormats(); setChangeNumbers(changeNumbers); }
PythonHighlighter::PythonHighlighter() { static QVector<TextEditor::TextStyle> categories; if (categories.isEmpty()) { categories << TextEditor::C_NUMBER << TextEditor::C_STRING << TextEditor::C_KEYWORD << TextEditor::C_TYPE << TextEditor::C_FIELD << TextEditor::C_JS_SCOPE_VAR << TextEditor::C_OPERATOR << TextEditor::C_COMMENT << TextEditor::C_DOXYGEN_COMMENT << TextEditor::C_TEXT << TextEditor::C_VISUAL_WHITESPACE << TextEditor::C_STRING; } setTextFormatCategories(categories); }
LuaHighlighter::LuaHighlighter() { static QVector<TextEditor::TextStyle> categories; if(categories.isEmpty()) { // see Format in scanner/luaformattoken.h categories << TextEditor::C_NUMBER << TextEditor::C_STRING << TextEditor::C_TYPE << TextEditor::C_FIELD << TextEditor::C_JS_SCOPE_VAR << TextEditor::C_KEYWORD << TextEditor::C_OPERATOR << TextEditor::C_COMMENT << TextEditor::C_COMMENT << TextEditor::C_TEXT << TextEditor::C_VISUAL_WHITESPACE << TextEditor::C_STRING; } setTextFormatCategories(categories); }
ProFileHighlighter::ProFileHighlighter(const Keywords &keywords) : m_keywords(keywords) { static const QVector<TextStyle> categories({C_TYPE, C_KEYWORD, C_COMMENT, C_VISUAL_WHITESPACE}); setTextFormatCategories(categories); }