Skip to content

UndoManager: Fix removal of oldest redo steps - #2531

Open
dl3sdo wants to merge 3 commits into
OpenOrienteering:masterfrom
dl3sdo:fix-undo-manager
Open

UndoManager: Fix removal of oldest redo steps#2531
dl3sdo wants to merge 3 commits into
OpenOrienteering:masterfrom
dl3sdo:fix-undo-manager

Conversation

@dl3sdo

@dl3sdo dl3sdo commented Jul 22, 2026

Copy link
Copy Markdown
Member

The map file stores redo steps in reversed order, which are then reinserted in reversed order. When the number of loaded steps exceeded the maximum undo/redo limit, then the newest redo steps were removed instead of the oldest ones.
Make max_undo_steps a class member and class UndoManagerTest a friend to allow testing with varying number of undo/redo steps.
Add test for saving and loading a map file with undo/redo steps to verify that these steps will be executed correctly after loading.
Test that limitation of undo/redo steps is done correctly if a map file is loaded that contains more steps than the maximum number of steps.

dl3sdo added 3 commits July 22, 2026 14:30
Make max_undo_steps a class member and class UndoManagerTest a friend
to allow testing with varying number of undo/redo steps.
The map file stores redo steps in reversed order, which are then
reinserted in reversed order. When the number of loaded steps
exceeded the maximum undo/redo limit, then the newest redo steps
were removed instead of the oldest ones.
Add test for saving and loading a map file with undo/redo steps to
verify that these steps will be executed correctly after loading.
Test that limitation of undo/redo steps is done correctly if a map file
is loaded that contains more steps than the maximum number of steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant