1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Fix out of sync when the script is edited externally via lsp

Previously, external editing via lsp would modify the modified time of the script,
which caused the internal display of the script to not be refreshed when refocusing
the engine.

Now saving the script externally via lsp will automatically refresh the internal
display.
This commit is contained in:
Rindbee
2022-09-25 23:13:39 +08:00
parent 15ac442247
commit 412e87349a
3 changed files with 27 additions and 23 deletions

View File

@@ -422,6 +422,7 @@ void GDScriptTextDocument::sync_script_content(const String &p_path, const Strin
if (error == OK) {
if (script->load_source_code(path) == OK) {
script->reload(true);
ScriptEditor::get_singleton()->reload_scripts(true); // Refresh scripts opened in the internal editor.
}
}
}