[Bf-blender-cvs] [cd2bf1fc91d] master: Fix T61191: First undo step missing in text editor
Campbell Barton
noreply at git.blender.org
Wed Feb 6 03:55:06 CET 2019
Commit: cd2bf1fc91d7d940ebd32be0ef60d04d0f2a8af1
Author: Campbell Barton
Date: Wed Feb 6 12:55:26 2019 +1100
Branches: master
https://developer.blender.org/rBcd2bf1fc91d7d940ebd32be0ef60d04d0f2a8af1
Fix T61191: First undo step missing in text editor
===================================================================
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 869c7d03af9..88a37e8e51d 100644
--- a/source/blender/editors/space_text/text_undo.c
+++ b/source/blender/editors/space_text/text_undo.c
@@ -65,16 +65,11 @@ typedef struct TextUndoStep {
TextUndoBuf data;
} TextUndoStep;
-static bool text_undosys_poll(bContext *C)
+static bool text_undosys_poll(bContext *UNUSED(C))
{
- Text *text = CTX_data_edit_text(C);
- if (text == NULL) {
- return false;
- }
- if (ID_IS_LINKED(text)) {
- return false;
- }
- return true;
+ /* Only use when operators initialized. */
+ UndoStack *ustack = ED_undo_stack_get();
+ return (ustack->step_init && (ustack->step_init->type == BKE_UNDOSYS_TYPE_TEXT));
}
static void text_undosys_step_encode_init(struct bContext *C, UndoStep *us_p)
More information about the Bf-blender-cvs
mailing list