summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/ConsoleWidget.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-07 16:56:02 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-07 16:56:02 +0100
commitddbf20ecf6c1e359a3b9f7c5ba7e0b5f3eec2f4d (patch)
treed55897c4c002ff69b34d9e79962055912bb1eb79 /Userland/Applications/Browser/ConsoleWidget.cpp
parent22baa5e64fdd60b780beef785fd76ad1bd70f9bf (diff)
downloadserenity-ddbf20ecf6c1e359a3b9f7c5ba7e0b5f3eec2f4d.zip
LibSyntax+LibGUI+LibJS: Move JS syntax highlighter to LibJS
This is a little bit messy but the basic idea is: Syntax::Highlighter now has a Syntax::HighlighterClient to talk to the outside world. It mostly communicates in LibGUI primitives that are available in headers, so inlineable. GUI::TextEditor inherits from Syntax::HighlighterClient. This let us to move GUI::JSSyntaxHighlighter to JS::SyntaxHighlighter and remove LibGUI's dependency on LibJS.
Diffstat (limited to 'Userland/Applications/Browser/ConsoleWidget.cpp')
-rw-r--r--Userland/Applications/Browser/ConsoleWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/Browser/ConsoleWidget.cpp b/Userland/Applications/Browser/ConsoleWidget.cpp
index 55c545dc55..ae132e50ba 100644
--- a/Userland/Applications/Browser/ConsoleWidget.cpp
+++ b/Userland/Applications/Browser/ConsoleWidget.cpp
@@ -28,13 +28,13 @@
#include <AK/StringBuilder.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
-#include <LibGUI/JSSyntaxHighlighter.h>
#include <LibGUI/TextBox.h>
#include <LibGfx/FontDatabase.h>
#include <LibJS/Interpreter.h>
#include <LibJS/MarkupGenerator.h>
#include <LibJS/Parser.h>
#include <LibJS/Runtime/Error.h>
+#include <LibJS/SyntaxHighlighter.h>
#include <LibWeb/DOM/DocumentType.h>
#include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/Text.h>
@@ -66,7 +66,7 @@ ConsoleWidget::ConsoleWidget()
bottom_container.set_fixed_height(22);
m_input = bottom_container.add<GUI::TextBox>();
- m_input->set_syntax_highlighter(make<GUI::JSSyntaxHighlighter>());
+ m_input->set_syntax_highlighter(make<JS::SyntaxHighlighter>());
// FIXME: Syntax Highlighting breaks the cursor's position on non fixed-width fonts.
m_input->set_font(Gfx::FontDatabase::default_fixed_width_font());
m_input->set_history_enabled(true);