[Bf-blender-cvs] [ea0abf52bfa] blender2.7: Fix T59165: Text operations fail to undo

Campbell Barton noreply at git.blender.org
Wed Jan 9 22:07:56 CET 2019


Commit: ea0abf52bfab2677f58023833146783e54f8f4c0
Author: Campbell Barton
Date:   Wed Jan 9 14:07:35 2019 +1100
Branches: blender2.7
https://developer.blender.org/rBea0abf52bfab2677f58023833146783e54f8f4c0

Fix T59165: Text operations fail to undo

Some undo operations encode multiple actions, now all are undone/redone.

===================================================================

M	source/blender/editors/space_text/text_undo.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list