summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r--editor/plugins/script_editor_plugin.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index c1a65b7bb7..fa6d710325 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1000,12 +1000,21 @@ void ScriptEditor::_res_saved_callback(const Ref<Resource> &p_res) {
}
}
+ if (p_res.is_valid()) {
+ // In case the Resource has built-in scripts.
+ _mark_built_in_scripts_as_saved(p_res->get_path());
+ }
+
_update_script_names();
trigger_live_script_reload();
}
void ScriptEditor::_scene_saved_callback(const String &p_path) {
// If scene was saved, mark all built-in scripts from that scene as saved.
+ _mark_built_in_scripts_as_saved(p_path);
+}
+
+void ScriptEditor::_mark_built_in_scripts_as_saved(const String &p_parent_path) {
for (int i = 0; i < tab_container->get_tab_count(); i++) {
ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(i));
if (!se) {
@@ -1018,7 +1027,7 @@ void ScriptEditor::_scene_saved_callback(const String &p_path) {
continue; // External script, who cares.
}
- if (edited_res->get_path().get_slice("::", 0) == p_path) {
+ if (edited_res->get_path().get_slice("::", 0) == p_parent_path) {
se->tag_saved_version();
}