Community
Participate
Working Groups
Created attachment 91734 [details] Simple program for reproducing the problem Build id: I20080207-1530 I am creating TextViewer and connect TextViewerUndoManager to it. I need to query the undo manager if roll back is possible and I am doing this in a textListener binded to the viewer. When I start typing in the TextViewer, TextViewerUndoManager#undoable() is always returning false in my text listener. If I use keyListener instead of textListener I am getting correct results. I think this might be a regression because the attached program is working fine in Eclipse 3.3.0 and it is broken in Eclipse 3.4M5.
Dani, if this is a regression since 3.3, i can't imagine it's anything that changed in the undo framework. Maybe in event timing? Moving to platform text. If it's something I need to look at, let me know. Sorry it took so long for me to realize what this was about...
This got introduced by fix for bug 209921. Note however, that it is never safe to query such information inside a text or document listener as the undo manager might also be a text listener and listener sequence is not guaranteed.
Use the key listener for now.
Just wondering, isn't this bug a regression compared to Eclipse 3.3 ? If it is a regression, do you still consider it minor? I'm not sure how many clients could be affected...
Yes, a regression but the fixed bug is more important and as far as I can remember there were other issues before when using the mentioned listener approach - which is logic as you have no clue whether your listener is called before or after the undo operation history has done its work. If you want to use the listener and be sure that it has the right result you could get the state inside an asyncExec.
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.