diff options
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 144aa2a1ef..cc9fc99b9c 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2067,6 +2067,11 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) { accept_event(); return; } + if (k->is_action("ui_text_remove_secondary_carets", true) && _should_remove_secondary_carets()) { + remove_secondary_carets(); + accept_event(); + return; + } if (k->is_action("ui_cut", true)) { cut(); accept_event(); @@ -2819,6 +2824,10 @@ void TextEdit::_move_caret_document_end(bool p_select) { } } +bool TextEdit::_should_remove_secondary_carets() { + return carets.size() > 1; +} + void TextEdit::_get_above_below_caret_line_column(int p_old_line, int p_old_wrap_index, int p_old_column, bool p_below, int &p_new_line, int &p_new_column, int p_last_fit_x) const { if (p_last_fit_x == -1) { p_last_fit_x = _get_column_x_offset_for_line(p_old_column, p_old_line, p_old_column); |