diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index f626891bd8e..caf877f4078 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1486,6 +1486,11 @@ void FileSystemDock::_try_move_item(const FileOrFolder &p_item, const String &p_ break; } } + } else { + Ref res = ResourceCache::get_ref(old_path); + if (res.is_valid()) { + res->set_path_cache(new_path); + } } } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 77dd61b2634..1a1e5697c2d 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1170,11 +1170,10 @@ void ScriptEditor::_live_auto_reload_running_scripts() { bool ScriptEditor::_test_script_times_on_disk(Ref p_for_script) { disk_changed_list->clear(); TreeItem *r = disk_changed_list->create_item(); - disk_changed_list->set_hide_root(true); bool need_ask = false; bool need_reload = false; - bool use_autoreload = bool(EDITOR_GET("text_editor/behavior/files/auto_reload_scripts_on_external_change")); + bool use_autoreload = EDITOR_GET("text_editor/behavior/files/auto_reload_scripts_on_external_change"); for (int i = 0; i < tab_container->get_tab_count(); i++) { ScriptEditorBase *se = Object::cast_to(tab_container->get_tab_control(i)); @@ -1188,12 +1187,12 @@ bool ScriptEditor::_test_script_times_on_disk(Ref p_for_script) { continue; //internal script, who cares } - uint64_t last_date = edited_res->get_last_modified_time(); - uint64_t date = FileAccess::get_modified_time(edited_res->get_path()); + uint64_t last_date = se->edited_file_data.last_modified_time; + uint64_t date = FileAccess::get_modified_time(se->edited_file_data.path); if (last_date != date) { TreeItem *ti = disk_changed_list->create_item(r); - ti->set_text(0, edited_res->get_path().get_file()); + ti->set_text(0, se->edited_file_data.path.get_file()); if (!use_autoreload || se->is_unsaved()) { need_ask = true; @@ -2231,11 +2230,6 @@ void ScriptEditor::_update_script_names() { Ref icon = se->get_theme_icon(); String path = se->get_edited_resource()->get_path(); bool saved = !path.is_empty(); - if (saved) { - // The script might be deleted, moved, or renamed, so make sure - // to update original path to previously edited resource. - se->set_meta("_edit_res_path", path); - } String name = se->get_name(); Ref