diff --git a/Applications/TextEditor/CMakeLists.txt b/Applications/TextEditor/CMakeLists.txt index 19820b5ffb..6a28b82c32 100644 --- a/Applications/TextEditor/CMakeLists.txt +++ b/Applications/TextEditor/CMakeLists.txt @@ -7,4 +7,4 @@ set(SOURCES ) serenity_bin(TextEditor) -target_link_libraries(TextEditor LibWeb LibMarkdown LibGUI LibDesktop) +target_link_libraries(TextEditor LibWeb LibMarkdown LibGUI LibShell LibDesktop) diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index 35a01efcff..0c8520501d 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -438,6 +439,13 @@ TextEditorWidget::TextEditorWidget() syntax_actions.add_action(*m_ini_highlight); syntax_menu.add_action(*m_ini_highlight); + m_shell_highlight = GUI::Action::create_checkable("Shell File", [&](auto&) { + m_editor->set_syntax_highlighter(make()); + m_editor->update(); + }); + syntax_actions.add_action(*m_shell_highlight); + syntax_menu.add_action(*m_shell_highlight); + auto& help_menu = menubar->add_menu("Help"); help_menu.add_action(GUI::Action::create("About", [&](auto&) { GUI::AboutDialog::show("Text Editor", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-text-editor.png"), window()); diff --git a/Applications/TextEditor/TextEditorWidget.h b/Applications/TextEditor/TextEditorWidget.h index 77da7c5eae..4a4cf465d5 100644 --- a/Applications/TextEditor/TextEditorWidget.h +++ b/Applications/TextEditor/TextEditorWidget.h @@ -104,6 +104,7 @@ private: RefPtr m_cpp_highlight; RefPtr m_js_highlight; RefPtr m_ini_highlight; + RefPtr m_shell_highlight; RefPtr m_page_view; diff --git a/DevTools/HackStudio/CMakeLists.txt b/DevTools/HackStudio/CMakeLists.txt index d695e0a523..c279dcddfb 100644 --- a/DevTools/HackStudio/CMakeLists.txt +++ b/DevTools/HackStudio/CMakeLists.txt @@ -32,4 +32,4 @@ set(SOURCES ) serenity_bin(HackStudio) -target_link_libraries(HackStudio LibWeb LibMarkdown LibGUI LibGfx LibCore LibVT LibDebug LibX86 LibDiff) +target_link_libraries(HackStudio LibWeb LibMarkdown LibGUI LibGfx LibCore LibVT LibDebug LibX86 LibDiff LibShell) diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp index baff5106eb..190fecf122 100644 --- a/DevTools/HackStudio/HackStudioWidget.cpp +++ b/DevTools/HackStudio/HackStudioWidget.cpp @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -216,6 +217,8 @@ void HackStudioWidget::open_file(const String& filename) current_editor().set_syntax_highlighter(make()); else if (filename.ends_with(".ini")) current_editor().set_syntax_highlighter(make()); + else if (filename.ends_with(".sh")) + current_editor().set_syntax_highlighter(make()); else current_editor().set_syntax_highlighter(nullptr);