@@ -173,7 +173,7 @@ func _enter_tree() -> void:
173173 installer = FormatterInstaller .new (formatter_cache_dir )
174174 add_child (installer )
175175 installer .installation_completed .connect (
176- func _on_installation_completed (binary_path : String ) -> void :
176+ func _on_installation_completed (binary_path : String ) -> void :
177177 set_editor_setting (SETTING_FORMATTER_PATH , binary_path )
178178 _has_formatter_command = has_command (binary_path )
179179 if not _has_formatter_command :
@@ -188,7 +188,7 @@ func _enter_tree() -> void:
188188 menu .update_menu (true ),
189189 )
190190 installer .installation_failed .connect (
191- func _on_installation_failed (error_message : String ) -> void :
191+ func _on_installation_failed (error_message : String ) -> void :
192192 push_error ("Formatter installation failed: " , error_message ),
193193 )
194194
@@ -306,6 +306,8 @@ func _on_resource_saved(saved_resource: Resource) -> void:
306306 if saved_resource is not GDScript :
307307 return
308308 var script := saved_resource as GDScript
309+ var do_format_on_save := get_editor_setting (SETTING_FORMAT_ON_SAVE ) as bool
310+
309311 # We should normally never hit this condition, I'm adding it as a
310312 # safety check and to document issues with format on save and built-in
311313 # scripts. We support formatting built-in scripts, but not formatting them
@@ -328,7 +330,6 @@ func _on_resource_saved(saved_resource: Resource) -> void:
328330 _already_warned_about_builtin_format_on_save = true
329331 return
330332
331- var do_format_on_save := get_editor_setting (SETTING_FORMAT_ON_SAVE ) as bool
332333 var editorconfig_format_on_save = get_editorconfig_format_on_save (script .resource_path )
333334 if editorconfig_format_on_save != null :
334335 do_format_on_save = editorconfig_format_on_save as bool
0 commit comments