summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Young <zachyoung@Zachs-MacBook-Air.local>2019-04-21 14:19:31 -0400
committerZach Young <zachyoung@Zachs-MacBook-Air.local>2019-04-21 17:20:58 -0400
commit516b80cd6549a8fcaa06b1bf1591b9b78508c8bc (patch)
treec0fdc49108c1a0609adf4a513f15cbebb7f72114
parent6d8b209fc5f5dcbce6f067ce0a26ba158a1817d9 (diff)
Fix completely #14835 -proper selection reset on undo
-rw-r--r--scene/gui/text_edit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index d06f066295..4e724759c9 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) {