summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor/tools/pythonhighlighter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/pythoneditor/tools/pythonhighlighter.cpp')
-rw-r--r--src/plugins/pythoneditor/tools/pythonhighlighter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/pythoneditor/tools/pythonhighlighter.cpp b/src/plugins/pythoneditor/tools/pythonhighlighter.cpp
index ea809c4e6f..32c59ef6b0 100644
--- a/src/plugins/pythoneditor/tools/pythonhighlighter.cpp
+++ b/src/plugins/pythoneditor/tools/pythonhighlighter.cpp
@@ -65,10 +65,21 @@ 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()) {
categories << TextEditor::C_NUMBER