File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
addons/GDQuest_GDScript_formatter Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,12 @@ func _on_resource_saved(saved_resource: Resource) -> void:
234234
235235 script .source_code = formatted_code
236236 ResourceSaver .save (script )
237- script .reload ()
237+ # The argument (keep_state parameter) tells Godot to try to preserve the
238+ # state of the script instance, like static variables. Without this,
239+ # attempting to reload tool scripts will fail with an error because they
240+ # are already instantiated in the editor and instantiated scripts are
241+ # not allowed to force reload without unloading first.
242+ script .reload (true )
238243
239244 var script_editor := EditorInterface .get_script_editor ()
240245 var open_script_editors := script_editor .get_open_script_editors ()
You can’t perform that action at this time.
0 commit comments