Skip to content

Commit c5cb193

Browse files
committed
Godot addon: allow using both reorder code and safe mode together
1 parent 3c203b8 commit c5cb193

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

addons/GDQuest_GDScript_formatter/plugin.gd

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,15 +449,11 @@ func format_code(script: GDScript, force_reorder := false) -> String:
449449
formatter_arguments.push_back("--indent-size=%d" % get_editor_setting(SETTING_INDENT_SIZE))
450450

451451
var should_reorder := force_reorder or get_editor_setting(SETTING_REORDER_CODE) as bool
452-
# TODO: remove this safety check once we have safe mode support for reorder_code
453-
if should_reorder and get_editor_setting(SETTING_SAFE_MODE):
454-
push_error("GDScript Formatter: Settings 'reorder_code' and 'safe_mode' settings are incompatible and cannot be used together.")
455-
return ""
456452

457453
if should_reorder:
458454
formatter_arguments.push_back("--reorder-code")
459455

460-
if not force_reorder and get_editor_setting(SETTING_SAFE_MODE):
456+
if get_editor_setting(SETTING_SAFE_MODE):
461457
formatter_arguments.push_back("--safe")
462458

463459
formatter_arguments.push_back(ProjectSettings.globalize_path(script_path))

0 commit comments

Comments
 (0)