瀏覽代碼

TextEditor: Auto-select C++ syntax highlighting for more extensions

Nico Weber 5 年之前
父節點
當前提交
629410b3d6
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Applications/TextEditor/TextEditorWidget.cpp

+ 2 - 1
Applications/TextEditor/TextEditorWidget.cpp

@@ -483,7 +483,8 @@ void TextEditorWidget::set_path(const LexicalPath& lexical_path)
     m_name = lexical_path.title();
     m_name = lexical_path.title();
     m_extension = lexical_path.extension();
     m_extension = lexical_path.extension();
 
 
-    if (m_extension == "cpp" || m_extension == "h") {
+    if (m_extension == "c" || m_extension == "cc" || m_extension == "cxx" ||
+        m_extension == "cpp" || m_extension == "h") {
         m_cpp_highlight->activate();
         m_cpp_highlight->activate();
     } else if (m_extension == "js" || m_extension == "json") {
     } else if (m_extension == "js" || m_extension == "json") {
         m_js_highlight->activate();
         m_js_highlight->activate();