diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-08 12:20:37 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-08 12:20:37 +0200 |
commit | eb6d6ab29f2ee2a86d76d1f6926ea1fa58ed0180 (patch) | |
tree | 1ce88444bbef152aee6b447ea69b7b28b7bc33e4 /editor/plugins/script_editor_plugin.cpp | |
parent | e85f6871ba9bf8993399136efbad5617dba11b0a (diff) | |
parent | 0b3fba45c6e8d2e65904804cfd4c9a219ea31d2a (diff) | |
download | redot-engine-eb6d6ab29f2ee2a86d76d1f6926ea1fa58ed0180.tar.gz |
Merge pull request #76658 from Paulb23/convert-indent-code-edit
Move convert_indent into CodeEdit
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 0e01b11028..c605844728 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -944,11 +944,7 @@ void ScriptEditor::_resave_scripts(const String &p_str) { se->insert_final_newline(); if (convert_indent_on_save) { - if (use_space_indentation) { - se->convert_indent_to_spaces(); - } else { - se->convert_indent_to_tabs(); - } + se->convert_indent(); } Ref<TextFile> text_file = scr; @@ -1299,11 +1295,7 @@ void ScriptEditor::_menu_option(int p_option) { current->insert_final_newline(); if (convert_indent_on_save) { - if (use_space_indentation) { - current->convert_indent_to_spaces(); - } else { - current->convert_indent_to_tabs(); - } + current->convert_indent(); } Ref<Resource> resource = current->get_edited_resource(); @@ -2451,11 +2443,7 @@ void ScriptEditor::save_current_script() { current->insert_final_newline(); if (convert_indent_on_save) { - if (use_space_indentation) { - current->convert_indent_to_spaces(); - } else { - current->convert_indent_to_tabs(); - } + current->convert_indent(); } Ref<Resource> resource = current->get_edited_resource(); @@ -2499,11 +2487,7 @@ void ScriptEditor::save_all_scripts() { } if (convert_indent_on_save) { - if (use_space_indentation) { - se->convert_indent_to_spaces(); - } else { - se->convert_indent_to_tabs(); - } + se->convert_indent(); } if (trim_trailing_whitespace_on_save) { @@ -2730,7 +2714,6 @@ void ScriptEditor::_editor_settings_changed() { trim_trailing_whitespace_on_save = EDITOR_GET("text_editor/behavior/files/trim_trailing_whitespace_on_save"); convert_indent_on_save = EDITOR_GET("text_editor/behavior/files/convert_indent_on_save"); - use_space_indentation = EDITOR_GET("text_editor/behavior/indent/type"); members_overview_enabled = EDITOR_GET("text_editor/script_list/show_members_overview"); help_overview_enabled = EDITOR_GET("text_editor/help/show_help_index"); @@ -4081,7 +4064,6 @@ ScriptEditor::ScriptEditor() { edit_pass = 0; trim_trailing_whitespace_on_save = EDITOR_GET("text_editor/behavior/files/trim_trailing_whitespace_on_save"); convert_indent_on_save = EDITOR_GET("text_editor/behavior/files/convert_indent_on_save"); - use_space_indentation = EDITOR_GET("text_editor/behavior/indent/type"); ScriptServer::edit_request_func = _open_script_request; |