mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
HackStudio: Use Javascript syntax highlighter
This commit is contained in:
parent
c2884d29d6
commit
b6e1c1b516
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