mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +00:00
HackStudio+TextEditor: Add the Shell syntax highlighter
This commit is contained in:
committed by
Andreas Kling
parent
72b68221cc
commit
c1fc27cab2
@@ -47,6 +47,7 @@
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/ShellSyntaxHighlighter.h>
|
||||
#include <LibGUI/Splitter.h>
|
||||
#include <LibGUI/StatusBar.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
@@ -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<GUI::ShellSyntaxHighlighter>());
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user