Fix TextEdit cursor position after undo remove text

It was going to where the text started, now it goes to where the text
ends.
This commit is contained in:
George Marques 2016-06-13 16:40:28 -03:00
parent d3dff93e33
commit 831ae2d510
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 7 additions and 2 deletions

View File

@ -3837,8 +3837,13 @@ void TextEdit::undo() {
} }
} }
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);
} else {
cursor_set_line(undo_stack_pos->get().from_line); cursor_set_line(undo_stack_pos->get().from_line);
cursor_set_column(undo_stack_pos->get().from_column); cursor_set_column(undo_stack_pos->get().from_column);
}
update(); update();
} }