feat: add Undo and UndoOrExit action variants#487
Conversation
|
Apologies for the delay in response, and thanks for the PRs.
I understand that it might be tricky to trigger a redraw for the undo, but we need to find a way to ensure the order of the actions. Ideally, we don't have action processing in two places. Perhaps some better queueing of the actions while escaping the action processing temporarily, from top of my head save-to-file-as may serve as an example and could be done more generically? Also, my gut feeling is that I'd prefer not to move the mouse handling at this point. Maybe there is a chance to revamp this later. But right now we can just pass everything we need to the method. I can elaborate more on this at a later point in time if need be, but I'm a bit short on spare time atm. |
|
I have one additional idea: If you have a look at #385, when merged, this could allow an early exit trigger for the Undo action. Perhaps we could call it "undo-action-when-undo-stack-emtpy" (experimental) for lack of better description. This would achieve an UndoOrExit, but doesn't need an extra UndoOrExit action. If that explanation made sense :) |
Summary
undoandundo-or-exitas new action variants for action chainsundo: plain action, no-op if nothing to undo, always continues the chainundo-or-exit: compound action — undo one step if possible, exit if nothing to undoprocess_actionsmethod for consistent Undo supportCloses #485
Related discussion: #481