diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-09 06:07:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-10 00:01:50 +0300 |
commit | ea0abf52bfab2677f58023833146783e54f8f4c0 (patch) | |
tree | ce66c9e7a48388013e2809fc5cc23082b1012b62 /source | |
parent | 49e3f08815af17704e94c0e9eba0c6228a43972a (diff) |
Fix T59165: Text operations fail to undo
Some undo operations encode multiple actions, now all are undone/redone.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_text/text_undo.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c index 729522cc8f4..b79a77a4353 100644 --- a/source/blender/editors/space_text/text_undo.c +++ b/source/blender/editors/space_text/text_undo.c @@ -121,12 +121,18 @@ static void text_undosys_step_decode(struct bContext *C, UndoStep *us_p, int dir if (dir < 0) { TextUndoBuf data = us->data; - txt_do_undo(text, &data); + while (data.pos > -1) { + txt_do_undo(text, &data); + } + BLI_assert(data.pos == -1); } else { TextUndoBuf data = us->data; data.pos = -1; - txt_do_redo(text, &data); + while (data.pos < us->data.pos) { + txt_do_redo(text, &data); + } + BLI_assert(data.pos == us->data.pos); } text_update_edited(text); |