mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:37:34 +00:00
TextEditor: Enable C++ syntax highlighting for .cpp and .h files :^)
This commit is contained in:
parent
bb8e65be41
commit
3d62cab90f
1 changed files with 5 additions and 0 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include <LibGUI/Action.h>
|
#include <LibGUI/Action.h>
|
||||||
#include <LibGUI/BoxLayout.h>
|
#include <LibGUI/BoxLayout.h>
|
||||||
#include <LibGUI/Button.h>
|
#include <LibGUI/Button.h>
|
||||||
|
#include <LibGUI/CppSyntaxHighlighter.h>
|
||||||
#include <LibGUI/FilePicker.h>
|
#include <LibGUI/FilePicker.h>
|
||||||
#include <LibGUI/FontDatabase.h>
|
#include <LibGUI/FontDatabase.h>
|
||||||
#include <LibGUI/MenuBar.h>
|
#include <LibGUI/MenuBar.h>
|
||||||
|
@ -415,6 +416,10 @@ void TextEditorWidget::set_path(const FileSystemPath& file)
|
||||||
m_path = file.string();
|
m_path = file.string();
|
||||||
m_name = file.title();
|
m_name = file.title();
|
||||||
m_extension = file.extension();
|
m_extension = file.extension();
|
||||||
|
|
||||||
|
if (m_extension == "cpp" || m_extension == "h")
|
||||||
|
m_editor->set_syntax_highlighter(make<GUI::CppSyntaxHighlighter>());
|
||||||
|
|
||||||
update_title();
|
update_title();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue