From 68088b629bed6883f2e9f5e389118030d319860b Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Thu, 29 Jul 2021 21:04:29 +0200 Subject: [PATCH] TextEditor: Add automatic syntax highlighting for Shell and .htm files --- Userland/Applications/TextEditor/MainWidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/TextEditor/MainWidget.cpp b/Userland/Applications/TextEditor/MainWidget.cpp index 9222fc1175..94948e9513 100644 --- a/Userland/Applications/TextEditor/MainWidget.cpp +++ b/Userland/Applications/TextEditor/MainWidget.cpp @@ -633,9 +633,11 @@ void MainWidget::set_path(StringView const& path) m_gml_highlight->activate(); } else if (m_extension == "ini") { m_ini_highlight->activate(); + } else if (m_extension == "sh" || m_extension == "bash") { + m_shell_highlight->activate(); } else if (m_extension == "sql") { m_sql_highlight->activate(); - } else if (m_extension == "html") { + } else if (m_extension == "html" || m_extension == "htm") { m_html_highlight->activate(); } else { m_plain_text_highlight->activate(); @@ -644,7 +646,7 @@ void MainWidget::set_path(StringView const& path) if (m_auto_detect_preview_mode) { if (m_extension == "md") set_preview_mode(PreviewMode::Markdown); - else if (m_extension == "html") + else if (m_extension == "html" || m_extension == "htm") set_preview_mode(PreviewMode::HTML); else set_preview_mode(PreviewMode::None);