diff options
author | Rindbee <idleman@yeah.net> | 2022-12-04 10:59:31 +0800 |
---|---|---|
committer | Rindbee <idleman@yeah.net> | 2023-01-22 18:27:22 +0800 |
commit | 64edc7a5c2397e5330a587d40b4d0275bf9a9c9e (patch) | |
tree | 80c704bac4c6a3b7397f1bcba7f06fc2c63ead4c /scene | |
parent | c3539b4561f9b4d7dc4ba1c5859217e7fbf9c6fe (diff) |
Fix internal editor not updating when using external editor via LSP
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/text_file.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/resources/text_file.cpp b/scene/resources/text_file.cpp index 9b61a95edb..77ff0f55b1 100644 --- a/scene/resources/text_file.cpp +++ b/scene/resources/text_file.cpp @@ -67,5 +67,10 @@ Error TextFile::load_text(const String &p_path) { ERR_FAIL_COND_V_MSG(s.parse_utf8((const char *)w) != OK, ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); text = s; path = p_path; +#ifdef TOOLS_ENABLED + if (ResourceLoader::get_timestamp_on_load()) { + set_last_modified_time(FileAccess::get_modified_time(path)); + } +#endif // TOOLS_ENABLED return OK; } |