undo fixes, viewer change_source rework, cleanup
[goodguy/history.git] / cinelerra-5.1 / cinelerra / mainundo.C
index bd048c10de5fa84fcc816206386b8079b753192c..a0aec63baf641caeef00ca699c33b61757faa89c 100644 (file)
@@ -190,11 +190,13 @@ int MainUndo::redo_load_flags()
 int MainUndo::undo()
 {
        mwindow->undo_commercial();
-
-       UndoStackItem *current = next_undo();
-// Now have an even number
+       UndoStackItem *current = undo_stack->current;
+       if( current ) {
+               undo_stack->current = next_undo();
+               if( undo_stack->number_of(current) % 2 )
+                       current = PREVIOUS; // Now have an even number
+       }
        if( current ) {
-               undo_stack->current = current;
 // Set the redo text to the current description
                if( mwindow->gui ) {
                        UndoStackItem *next = NEXT;