forked from qt-creator/qt-creator
TextEditor: Simplify configuring generic highlighter
* configureMimeType -> configureGenericHighlighter, since that is what it actually does. * setupAsPlainEditor -> setupGenericHighlighter, since that is what it actually does * avoid multiple highlighting definition lookups * unify code paths by not separately creating generic highlighters through the factories Change-Id: I9579ca5736bbf08c01b8e41b63c6b9f36bdc725e Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<glob pattern="*.cmake"/>
|
||||
</mime-type>
|
||||
<mime-type type="text/x-cmake-project">
|
||||
<sub-class-of type="text/plain"/>
|
||||
<sub-class-of type="text/x-cmake"/>
|
||||
<comment>CMake Project file</comment>
|
||||
<glob pattern="CMakeLists.txt"/>
|
||||
</mime-type>
|
||||
|
||||
@@ -274,7 +274,7 @@ CMakeEditorFactory::CMakeEditorFactory(CMakeSettingsPage *settingsPage)
|
||||
setEditorCreator([]() { return new CMakeEditor; });
|
||||
setEditorWidgetCreator([]() { return new CMakeEditorWidget; });
|
||||
setDocumentCreator([]() { return new CMakeDocument; });
|
||||
setGenericSyntaxHighlighterByName(QLatin1String("CMake"));
|
||||
setUseGenericHighlighter(true);
|
||||
setCommentStyle(Utils::CommentDefinition::HashStyle);
|
||||
setCodeFoldingSupported(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user