From aea0761b25276527e2f0099fb8b05a4a879d3c44 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sun, 13 Oct 2019 15:29:20 +0100 Subject: Place caret at 0,0 when setting text not at the end --- scene/gui/text_edit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a22ddb265b..adaff17fbb 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4751,6 +4751,9 @@ void TextEdit::set_text(String p_text) { selection.active = false; } + cursor_set_line(0); + cursor_set_column(0); + update(); setting_text = false; }; -- cgit v1.2.3 From d579d2bf1d3d868fc20018893247c210dfcc0550 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sun, 13 Oct 2019 15:34:28 +0100 Subject: Fix undo / redo scrollbar calulations --- scene/gui/text_edit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index adaff17fbb..44bc5cf749 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -6023,6 +6023,7 @@ 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_column(undo_stack_pos->get().to_column); @@ -6058,6 +6059,8 @@ void TextEdit::redo() { break; } } + + _update_scrollbars(); cursor_set_line(undo_stack_pos->get().to_line); cursor_set_column(undo_stack_pos->get().to_column); undo_stack_pos = undo_stack_pos->next(); -- cgit v1.2.3