Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Use Standard syntax highlighter in CodeEditorBase instead of Plain Text

gilzoideed2a82c4078b
diff --git a/editor/script/script_editor_base.cpp b/editor/script/script_editor_base.cpp
index 5bf7e67a886..cdf7b8bfbb8 100644
--- a/editor/script/script_editor_base.cpp
+++ b/editor/script/script_editor_base.cpp
@@ -946,6 +946,19 @@ bool CodeEditorBase::_edit_option(int p_option) {
return true;
}
+void CodeEditorBase::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_READY: {
+ for (const Ref<EditorSyntaxHighlighter> &highlighter : highlighters) {
+ if (Object::cast_to<EditorStandardSyntaxHighlighter>(highlighter.ptr())) {
+ set_syntax_highlighter(highlighter);
+ break;
+ }
+ }
+ } break;
+ }
+}
+
CodeEditorBase::CodeEditorBase() {
code_editor->set_code_complete_func(_code_complete_scripts, this);
code_editor->connect("show_warnings_panel", callable_mp(this, &CodeEditorBase::_show_warnings_panel));
diff --git a/editor/script/script_editor_base.h b/editor/script/script_editor_base.h
index 5863545638c..9222727abd0 100644
--- a/editor/script/script_editor_base.h
+++ b/editor/script/script_editor_base.h
@@ -290,6 +290,8 @@ protected:
virtual void _breakpoint_toggled(int p_row) = 0;
+ void _notification(int p_what);
+
public:
virtual bool show_members_overview() override { return true; }