From 969136e6756a3326862faccad8c8f02805ac0795 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 4 Nov 2021 14:30:04 +0100 Subject: [PATCH] Ignore external editor for built-in scripts (cherry picked from commit 9abb07efb4c2a3ef1f3911fa50eb4fc46e1a16de) --- editor/editor_node.cpp | 3 ++- editor/plugins/script_editor_plugin.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f8614b99a14..8a7e401267b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2108,7 +2108,8 @@ void EditorNode::_edit_current() { if (main_plugin) { // special case if use of external editor is true - if (main_plugin->get_name() == "Script" && current_obj->get_class_name() != StringName("VisualScript") && (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { + Resource *res = Object::cast_to(current_obj); + if (main_plugin->get_name() == "Script" && current_obj->get_class_name() != StringName("VisualScript") && res && !res->get_path().empty() && res->get_path().find("::") == -1 && (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { if (!changing_scene) { main_plugin->edit(current_obj); } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index fc51dc31a2b..e2d8ff7f851 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1969,9 +1969,10 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra Ref