diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index b775f1e9c1..7dec041197 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2054,7 +2054,7 @@ void TextEdit::backspace_at_cursor() { } } - cursor_set_line(prev_line, true, true); + cursor_set_line(prev_line, false, true); cursor_set_column(prev_column); } @@ -2933,7 +2933,7 @@ void TextEdit::_gui_input(const Ref &p_gui_input) { selection.active = false; update(); _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); - cursor_set_line(selection.from_line, true, false); + cursor_set_line(selection.from_line, false, false); cursor_set_column(selection.from_column); update(); } @@ -4282,7 +4282,7 @@ void TextEdit::_insert_text_at_cursor(const String &p_text) { int new_column, new_line; _insert_text(cursor.line, cursor.column, p_text, &new_line, &new_column); _update_scrollbars(); - cursor_set_line(new_line); + cursor_set_line(new_line, false); cursor_set_column(new_column); update(); @@ -4878,7 +4878,7 @@ int TextEdit::get_column_x_offset(int p_char, String p_str) const { void TextEdit::insert_text_at_cursor(const String &p_text) { if (selection.active) { - cursor_set_line(selection.from_line); + cursor_set_line(selection.from_line, false); cursor_set_column(selection.from_column); _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); @@ -5337,7 +5337,7 @@ void TextEdit::cut() { OS::get_singleton()->set_clipboard(clipboard); _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); - cursor_set_line(selection.from_line); // Set afterwards else it causes the view to be offset. + cursor_set_line(selection.from_line, false); // Set afterwards else it causes the view to be offset. cursor_set_column(selection.from_column); selection.active = false; @@ -5369,7 +5369,7 @@ void TextEdit::paste() { selection.active = false; selection.selecting_mode = Selection::MODE_NONE; _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); - cursor_set_line(selection.from_line); + cursor_set_line(selection.from_line, false); cursor_set_column(selection.from_column); } else if (!cut_copy_line.empty() && cut_copy_line == clipboard) { @@ -6224,11 +6224,11 @@ void TextEdit::undo() { _update_scrollbars(); if (undo_stack_pos->get().type == TextOperation::TYPE_REMOVE) { - cursor_set_line(undo_stack_pos->get().to_line); + cursor_set_line(undo_stack_pos->get().to_line, false); cursor_set_column(undo_stack_pos->get().to_column); _cancel_code_hint(); } else { - cursor_set_line(undo_stack_pos->get().from_line); + cursor_set_line(undo_stack_pos->get().from_line, false); cursor_set_column(undo_stack_pos->get().from_column); } update(); @@ -6260,7 +6260,7 @@ void TextEdit::redo() { } _update_scrollbars(); - cursor_set_line(undo_stack_pos->get().to_line); + cursor_set_line(undo_stack_pos->get().to_line, false); cursor_set_column(undo_stack_pos->get().to_column); undo_stack_pos = undo_stack_pos->next(); update();