From 516b80cd6549a8fcaa06b1bf1591b9b78508c8bc Mon Sep 17 00:00:00 2001 From: Zach Young Date: Sun, 21 Apr 2019 14:19:31 -0400 Subject: [PATCH] Fix completely #14835 -proper selection reset on undo --- 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 d06f0662955..4e724759c91 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5340,6 +5340,9 @@ void TextEdit::undo() { TextOperation op = undo_stack_pos->get(); _do_text_op(op, true); + if (op.from_line != op.to_line || op.to_column != op.from_column + 1) + select(op.from_line, op.from_column, op.to_line, op.to_column); + current_op.version = op.prev_version; if (undo_stack_pos->get().chain_backward) { while (true) {