diff options
Diffstat (limited to 'editor/plugins/text_editor.cpp')
-rw-r--r-- | editor/plugins/text_editor.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 6070e08739..e19d9d933a 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -380,10 +380,10 @@ void TextEditor::_edit_option(int p_op) { callable_mp((Control *)tx, &Control::grab_focus).call_deferred(); } break; case EDIT_MOVE_LINE_UP: { - code_editor->move_lines_up(); + code_editor->get_text_editor()->move_lines_up(); } break; case EDIT_MOVE_LINE_DOWN: { - code_editor->move_lines_down(); + code_editor->get_text_editor()->move_lines_down(); } break; case EDIT_INDENT: { tx->indent_lines(); @@ -392,24 +392,16 @@ void TextEditor::_edit_option(int p_op) { tx->unindent_lines(); } break; case EDIT_DELETE_LINE: { - code_editor->delete_lines(); + code_editor->get_text_editor()->delete_lines(); } break; case EDIT_DUPLICATE_SELECTION: { - code_editor->duplicate_selection(); + code_editor->get_text_editor()->duplicate_selection(); } break; case EDIT_DUPLICATE_LINES: { code_editor->get_text_editor()->duplicate_lines(); } break; case EDIT_TOGGLE_FOLD_LINE: { - int previous_line = -1; - for (int caret_idx : tx->get_caret_index_edit_order()) { - int line_idx = tx->get_caret_line(caret_idx); - if (line_idx != previous_line) { - tx->toggle_foldable_line(line_idx); - previous_line = line_idx; - } - } - tx->queue_redraw(); + tx->toggle_foldable_lines_at_carets(); } break; case EDIT_FOLD_ALL_LINES: { tx->fold_all_lines(); @@ -531,7 +523,7 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { } } if (!tx->has_selection()) { - tx->set_caret_line(row, true, false); + tx->set_caret_line(row, true, false, -1); tx->set_caret_column(col); } } |