Git: Move submit highlighter to a separate file

Change-Id: I61e07b2abe3b1da1b56935bb3ce528a5f571705f
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-06-02 23:04:17 +03:00
committed by Orgad Shaneh
parent bcd8c02aea
commit 3e022beb12
7 changed files with 178 additions and 95 deletions

View File

@@ -93,25 +93,6 @@ private:
bool m_isInitialized;
};
// Highlighter for git submit messages. Make the first line bold, indicates
// comments as such (retrieving the format from the text editor) and marks up
// keywords (words in front of a colon as in 'Task: <bla>').
class GitSubmitHighlighter : public TextEditor::SyntaxHighlighter
{
public:
explicit GitSubmitHighlighter(QTextEdit *parent);
explicit GitSubmitHighlighter(TextEditor::BaseTextDocument *parent);
void highlightBlock(const QString &text);
void initialize();
private:
enum State { None = -1, Header, Other };
QTextCharFormat m_commentFormat;
QRegExp m_keywordPattern;
QChar m_hashChar;
};
} // namespace Internal
} // namespace Git