forked from qt-creator/qt-creator
Implement syntax highlighting in diff editor
All Qt Creator's main highlighters are used in the first place, for other mimetypes generic highlighter is used as a fallback. Task-number: QTCREATORBUG-9580 Change-Id: I863b9085520e5bdda142ce88f2074afeacee0531 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
This commit is contained in:
@@ -65,9 +65,20 @@ using namespace PythonEditor::Internal;
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
PythonHighlighter::PythonHighlighter(QTextDocument *parent) :
|
||||
TextEditor::SyntaxHighlighter(parent)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
/// New instance created when opening any document in editor
|
||||
PythonHighlighter::PythonHighlighter(TextEditor::BaseTextDocument *parent) :
|
||||
TextEditor::SyntaxHighlighter(parent)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
void PythonHighlighter::init()
|
||||
{
|
||||
static QVector<TextEditor::TextStyle> categories;
|
||||
if (categories.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user