Bug 497675 - Undo stack does not clear redo-portion when adding a new operation
Summary: Undo stack does not clear redo-portion when adding a new operation
Status: RESOLVED WORKSFORME
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8.2   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2016-07-11 08:50 EDT by Manfred Stadel CLA
Modified: 2019-09-02 15:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manfred Stadel CLA 2016-07-11 08:50:18 EDT
Assume the following sequence of change operations performed on any of the PDE form editors (note org.eclipse.pde.internal.ui.editor.ModelUndoManager maintains an undo stack):
1. Change A  ==> undo stack contains A*          (* marks the cursor position)
2. Change B  ==> undo stack contains A - B* 
3. Undo (B)  ==> undo stack contains A* - B      (B ready to be redone)
4. Change C  ==> undo stack contains A - B - C*
                 but should contain A - C*, shouldn't it?
If now Undo is performed twice, it will first undo (C) and then undo (B) a second time. Fortunately for many ops undo is idempotent so that performing undo (B) a second time will not be very harmful.

To fix the problem, method ModelUndoManager#addOperation should clear the redo-portion (here B) of the undo/redo stack before adding a new operation (here C).
Comment 1 Vikas Chandra CLA 2016-07-12 04:49:38 EDT
Similar bug is bug 432403.
Comment 2 Eclipse Genie CLA 2018-12-08 08:09:05 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Lars Vogel CLA 2019-09-02 15:02:34 EDT
This bug has been marked as stalebug a while ago without any further interaction.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard flag.
Comment 4 Lars Vogel CLA 2019-09-02 15:04:43 EDT
This bug was marked as stalebug a while ago. Marking as worksforme.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.