diff options
author | Paulb23 <p_batty@hotmail.co.uk> | 2023-05-01 21:41:50 +0100 |
---|---|---|
committer | Paulb23 <p_batty@hotmail.co.uk> | 2023-05-07 13:08:37 +0100 |
commit | 0b3fba45c6e8d2e65904804cfd4c9a219ea31d2a (patch) | |
tree | de45f1e29863fe7601b21c964cb60d490808bcf9 /editor/plugins/script_editor_plugin.cpp | |
parent | 64eeb04d2cb2e269d9710c38bdbf366ab3656e76 (diff) | |
download | redot-engine-0b3fba45c6e8d2e65904804cfd4c9a219ea31d2a.tar.gz |
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; |