diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-11 02:42:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-11 02:46:47 +0300 |
commit | 676543d91f5c9f441cd0544d99aa34c933570347 (patch) | |
tree | 09c205c810c7fb2dce57d98157438347dd46298c /source/blender/editors/space_text/text_undo.c | |
parent | 1544b9322c4f8728277a7a24b028bab95f22f7d6 (diff) |
Fix T66658: Undo steps gets out sync with text/edit-mode
Diffstat (limited to 'source/blender/editors/space_text/text_undo.c')
-rw-r--r-- | source/blender/editors/space_text/text_undo.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c index ae12473e600..66cbaa8bb5b 100644 --- a/source/blender/editors/space_text/text_undo.c +++ b/source/blender/editors/space_text/text_undo.c @@ -130,7 +130,7 @@ static void text_undosys_step_decode_redo_impl(Text *text, TextUndoStep *us) us->step.is_applied = true; } -static void text_undosys_step_decode_undo(TextUndoStep *us) +static void text_undosys_step_decode_undo(TextUndoStep *us, bool is_final) { TextUndoStep *us_iter = us; while (us_iter->step.next && (us_iter->step.next->type == us_iter->step.type)) { @@ -140,13 +140,16 @@ static void text_undosys_step_decode_undo(TextUndoStep *us) us_iter = (TextUndoStep *)us_iter->step.next; } Text *text_prev = NULL; - while (us_iter != us) { + while ((us_iter != us) || (is_final && us_iter == us)) { Text *text = us_iter->text_ref.ptr; text_undosys_step_decode_undo_impl(text, us_iter); if (text_prev != text) { text_update_edited(text); text_prev = text; } + if (is_final) { + break; + } us_iter = (TextUndoStep *)us_iter->step.prev; } } @@ -176,12 +179,12 @@ static void text_undosys_step_decode_redo(TextUndoStep *us) } static void text_undosys_step_decode( - struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, int dir, bool UNUSED(is_final)) + struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, int dir, bool is_final) { TextUndoStep *us = (TextUndoStep *)us_p; if (dir < 0) { - text_undosys_step_decode_undo(us); + text_undosys_step_decode_undo(us, is_final); } else { text_undosys_step_decode_redo(us); |