From 6abb40990abacc6991f21b6c68dfa41c73591b24 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 13 Feb 2025 16:15:22 +0100 Subject: [PATCH] Fix modified time when LSP reload script --- editor/plugins/script_editor_plugin.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 8461d837e69..af7812abe80 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2843,10 +2843,13 @@ void ScriptEditor::_reload_scripts(bool p_refresh_only) { Ref edited_res = se->get_edited_resource(); if (edited_res->is_built_in()) { - continue; //internal script, who cares + continue; // Internal script, who cares. } - if (!p_refresh_only) { + if (p_refresh_only) { + // Make sure the modified time is correct. + se->edited_file_data.last_modified_time = FileAccess::get_modified_time(edited_res->get_path()); + } else { uint64_t last_date = se->edited_file_data.last_modified_time; uint64_t date = FileAccess::get_modified_time(edited_res->get_path());