Undo Systems
An undo stack and a redo stack This is the most common way to implement undo and redo. It’s used in almost everything that supports undo. Whenever you make a change, the previous state is saved to the undo stack. When you undo something, the most recent change is popped off of the undo stack and pushed onto the redo stack. Finally, if you undo some changes and then starts modifying the document, the redo stack is cleared....