Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-02-06 04:55:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-06 04:59:38 +0300
commitcd2bf1fc91d7d940ebd32be0ef60d04d0f2a8af1 (patch)
tree83daa539977b40c32c2578944724eed590612580 /source/blender
parente535ff44ffd686def7aafec401acec657f5a614c (diff)
Fix T61191: First undo step missing in text editor
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_text/text_undo.c13
1 files changed, 4 insertions, 9 deletions
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)