forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -131,7 +131,8 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc
|
||||
d->preview->setPlainText(QLatin1String(CppEditor::Constants::DEFAULT_CODE_STYLE_SNIPPETS[0]));
|
||||
d->preview->textDocument()->setIndenter(new ClangFormatIndenter(d->preview->document()));
|
||||
d->preview->textDocument()->setFontSettings(TextEditor::TextEditorSettings::fontSettings());
|
||||
d->preview->textDocument()->setSyntaxHighlighter(new CppEditor::CppHighlighter);
|
||||
d->preview->textDocument()->setSyntaxHighlighterCreator(
|
||||
[] { return new CppEditor::CppHighlighter(); });
|
||||
d->preview->textDocument()->indenter()->setFileName(fileName);
|
||||
|
||||
using namespace Layouting;
|
||||
|
||||
Reference in New Issue
Block a user