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/text_editor.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/text_editor.cpp')
-rw-r--r-- | editor/plugins/text_editor.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 174588b92e..7a76e4f989 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -288,12 +288,8 @@ void TextEditor::insert_final_newline() { code_editor->insert_final_newline(); } -void TextEditor::convert_indent_to_spaces() { - code_editor->convert_indent_to_spaces(); -} - -void TextEditor::convert_indent_to_tabs() { - code_editor->convert_indent_to_tabs(); +void TextEditor::convert_indent() { + code_editor->get_text_editor()->convert_indent(); } void TextEditor::tag_saved_version() { @@ -419,10 +415,12 @@ void TextEditor::_edit_option(int p_op) { trim_trailing_whitespace(); } break; case EDIT_CONVERT_INDENT_TO_SPACES: { - convert_indent_to_spaces(); + tx->set_indent_using_spaces(true); + convert_indent(); } break; case EDIT_CONVERT_INDENT_TO_TABS: { - convert_indent_to_tabs(); + tx->set_indent_using_spaces(false); + convert_indent(); } break; case EDIT_TO_UPPERCASE: { _convert_case(CodeTextEditor::UPPER); |