[Bf-blender-cvs] [ca8f5219718] master: Undo System: switch active text block when undoing

Campbell Barton noreply at git.blender.org
Thu Jan 10 04:11:51 CET 2019


Commit: ca8f5219718e7d13185d68f3e69ceb4d057c76e7
Author: Campbell Barton
Date:   Thu Jan 10 14:07:59 2019 +1100
Branches: master
https://developer.blender.org/rBca8f5219718e7d13185d68f3e69ceb4d057c76e7

Undo System: switch active text block when undoing

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

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 29871bf5c85..b427ce43dbb 100644
--- a/source/blender/editors/space_text/text_undo.c
+++ b/source/blender/editors/space_text/text_undo.c
@@ -134,9 +134,14 @@ static void text_undosys_step_decode(struct bContext *C, UndoStep *us_p, int dir
 		BLI_assert(data.pos == us->data.pos);
 	}
 
+	SpaceText *st = CTX_wm_space_text(C);
+	if (st) {
+		/* Not essential, always show text being undo where possible. */
+		st->text = text;
+	}
 	text_update_edited(text);
 	text_update_cursor_moved(C);
-	text_drawcache_tag_update(CTX_wm_space_text(C), 1);
+	text_drawcache_tag_update(st, 1);
 	WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
 }



More information about the Bf-blender-cvs mailing list