diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2023-02-09 14:01:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-09 14:01:33 +0100 |
commit | b12bf7ff0219bfec86d481b35355a43ee0ee59fa (patch) | |
tree | 559442ee0b4a412276622e15b0e50770a4a6e259 /scene/resources | |
parent | d02a7bc00d76d50843f1b938914340135060a119 (diff) | |
parent | 64edc7a5c2397e5330a587d40b4d0275bf9a9c9e (diff) |
Merge pull request #69550 from Rindbee/fix-script-editor-not-reload-via-lsp
Fix internal editor not updating when using external editor via LSP
Diffstat (limited to 'scene/resources')
-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; } |