1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

HackStudio: Apply INI syntax highlighter when opening a .ini file

This commit is contained in:
Linus Groh 2020-05-07 15:32:05 +01:00 committed by Andreas Kling
parent 7571e9e460
commit 8d01fd9863

View file

@ -48,6 +48,7 @@
#include <LibGUI/Application.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/INISyntaxHighlighter.h>
#include <LibGUI/CppSyntaxHighlighter.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/InputBox.h>
@ -735,6 +736,8 @@ void open_file(const String& filename)
current_editor().set_syntax_highlighter(make<GUI::CppSyntaxHighlighter>());
else if (filename.ends_with(".js"))
current_editor().set_syntax_highlighter(make<GUI::JSSyntaxHighlighter>());
else if (filename.ends_with(".ini"))
current_editor().set_syntax_highlighter(make<GUI::IniSyntaxHighlighter>());
else
current_editor().set_syntax_highlighter(nullptr);