1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:28:14 +00:00

LibGUI: Fix undo stack reporting wrong modified state

Since the `redo` action never goes back to `index: 0`,
we have to mark the clean index as being the current
non-empty index for the undo/redo navigation to work properly.

The problem is that if we never `undo`, the stack index stays at zero,
which is the empty container waiting for commands. In that situation,
if we save the document, it registers the clean index as being 1
(the non-empty index) but because the stack index has never left zero,
the document was being reported as modified, being out of sync with
the window modified state.
This commit is contained in:
Carlos César Neves Enumo 2021-05-08 04:51:52 -03:00 committed by Linus Groh
parent 3c01de4f0b
commit 0b7e19e2bb
2 changed files with 12 additions and 6 deletions

View file

@ -32,6 +32,8 @@ public:
void clear();
private:
size_t non_empty_stack_index() const;
struct Combo {
NonnullOwnPtrVector<Command> commands;
};