Skip to content
Snippets Groups Projects
Commit 34aa7752 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'guillembartrina/purr-data-undosystem-match-with-vanilla' into multi-step-undo

parents 3bb9a96b 8d80ed65
No related branches found
No related tags found
2 merge requests!433Multi step undo,!392fix, prevent from crashing when there's no sequence starting point
Pipeline #2050 passed
......@@ -133,15 +133,20 @@ void canvas_undo_undo(t_canvas *x)
bug("undo sequence missing start");
}
canvas_undo_doit(x, x->u_last, UNDO_UNDO);
/* prevent from crashing if there was no sequence starting point */
if(x->u_last != x->u_queue)
{
canvas_undo_doit(x, x->u_last, UNDO_UNDO);
x->u_last = x->u_last->prev;
}
x->u_last = x->u_last->prev;
char *undo_action = x->u_last->name;
char *redo_action = x->u_last->next->name;
we_are_undoing = 0;
/* here we call updating of all unpaired hubs and nodes since
their regular call will fail in case their position needed
to be updated by undo/redo first to reflect the old one */
their regular call will fail in case their position needed
to be updated by undo/redo first to reflect the old one */
glob_preset_node_list_seek_hub();
glob_preset_node_list_check_loc_and_update();
if (glist_isvisible(x) && glist_istoplevel(x))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment