From 3d62cab90fa5cafd918c548017acc839af21c4d3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 7 Feb 2020 20:12:25 +0100 Subject: [PATCH] TextEditor: Enable C++ syntax highlighting for .cpp and .h files :^) --- Applications/TextEditor/TextEditorWidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index 70b6a8cf78..4354167207 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -415,6 +416,10 @@ void TextEditorWidget::set_path(const FileSystemPath& file) m_path = file.string(); m_name = file.title(); m_extension = file.extension(); + + if (m_extension == "cpp" || m_extension == "h") + m_editor->set_syntax_highlighter(make()); + update_title(); }