diff options
author | Artem Sokolovskii <artem.sokolovskii@qt.io> | 2023-05-04 14:43:37 +0200 |
---|---|---|
committer | Artem Sokolovskii <artem.sokolovskii@qt.io> | 2023-11-20 14:52:20 +0000 |
commit | 4bfc3476f444ad614a6aeba100d85e869ec69b1f (patch) | |
tree | ebbd20b954644f5e0ce246e32a708f488256728e /src/plugins/cppeditor/cppeditordocument.cpp | |
parent | b8c2be4cf83aadc831ab795cee2b39421932f0e1 (diff) |
SyntaxHighlighter: Move highlighter creating to TextDocument
Added setSyntaxHighlighterCreator function to TextDocument
which allows the creation of highlighters inside TextDocument.
Change-Id: I454f800c878c48a154dad5abd68b7a4f9ceb378a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/cppeditor/cppeditordocument.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppeditordocument.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index 18c729f777..dfc5af1c88 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -79,7 +79,7 @@ private: CppEditorDocument::CppEditorDocument() { setId(CppEditor::Constants::CPPEDITOR_ID); - setSyntaxHighlighter(new CppHighlighter); + setSyntaxHighlighterCreator([] { return new CppHighlighter(); }); ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(Constants::CPP_SETTINGS_ID); |