RFR: JDK-8290010: IGV: Fix UndoRedo Action [v2]
Tobias Holenstein
tholenstein at openjdk.org
Mon Oct 24 12:31:58 UTC 2022
On Mon, 24 Oct 2022 10:40:55 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> In general, it seems that when going backwards (undo) multiple steps, going forwards (redo) does not work anymore after one step forward.
Hi @TobiHartmann
Thanks for trying it out and reporting. It should be fixed now!
The problem was that during `undo()`/ `redo()` we recorded new states to the history with `addUndo()`
The fix is to disable `addUndo()` while performing `undo()`/ `redo()`
When we now call `redo()` should we have now the following behavior:
1. (1)->(2)->**(3)** → _undo (2), redo (-)_
- we select _undo (2)_
2. (1)->**(2)** → _undo (1), redo (3)_
- if we now redo (3) we end up in 1.
- if we change the selection or the graph we override state (3) in the history and end up in 3.
3. (1)->(2)->**(4)** → _undo (2), redo (-)_
- we select _undo (2)_
4. (1)->**(2)** → _undo (1), redo (4)_
- state (3) cannot be reached anymore because we rewrote the history
(Nr) represents a saved state, -> is a recording with `addUndo()`, right of → are the possible actions at the **bold** state
-------------
PR: https://git.openjdk.org/jdk/pull/10813
More information about the hotspot-compiler-dev
mailing list