diff options
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; |