mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
HackStudio: Use Javascript syntax highlighter
This commit is contained in:
parent
c2884d29d6
commit
b6e1c1b516
Notes:
sideshowbarker
2024-07-19 08:19:26 +09:00
Author: https://github.com/oriko1010
Commit: b6e1c1b516
Pull-request: https://github.com/SerenityOS/serenity/pull/1435
2 changed files with 6 additions and 1 deletions
|
@ -17,6 +17,6 @@ OBJS = \
|
||||||
|
|
||||||
PROGRAM = HackStudio
|
PROGRAM = HackStudio
|
||||||
|
|
||||||
LIB_DEPS = GUI Web VT Protocol Markdown Gfx IPC Thread Pthread Core
|
LIB_DEPS = GUI Web VT Protocol Markdown Gfx IPC Thread Pthread Core JS
|
||||||
|
|
||||||
include ../../Makefile.common
|
include ../../Makefile.common
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include <LibGUI/CppSyntaxHighlighter.h>
|
#include <LibGUI/CppSyntaxHighlighter.h>
|
||||||
#include <LibGUI/FilePicker.h>
|
#include <LibGUI/FilePicker.h>
|
||||||
#include <LibGUI/InputBox.h>
|
#include <LibGUI/InputBox.h>
|
||||||
|
#include <LibGUI/JSSyntaxHighlighter.h>
|
||||||
#include <LibGUI/Label.h>
|
#include <LibGUI/Label.h>
|
||||||
#include <LibGUI/Menu.h>
|
#include <LibGUI/Menu.h>
|
||||||
#include <LibGUI/MenuBar.h>
|
#include <LibGUI/MenuBar.h>
|
||||||
|
@ -590,6 +591,10 @@ void open_file(const String& filename)
|
||||||
|
|
||||||
if (filename.ends_with(".cpp") || filename.ends_with(".h"))
|
if (filename.ends_with(".cpp") || filename.ends_with(".h"))
|
||||||
current_editor().set_syntax_highlighter(make<GUI::CppSyntaxHighlighter>());
|
current_editor().set_syntax_highlighter(make<GUI::CppSyntaxHighlighter>());
|
||||||
|
else if (filename.ends_with(".js"))
|
||||||
|
current_editor().set_syntax_highlighter(make<GUI::JSSyntaxHighlighter>());
|
||||||
|
else
|
||||||
|
current_editor().set_syntax_highlighter(nullptr);
|
||||||
|
|
||||||
if (filename.ends_with(".frm")) {
|
if (filename.ends_with(".frm")) {
|
||||||
set_edit_mode(EditMode::Form);
|
set_edit_mode(EditMode::Form);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue