Bug 221638 - [implementation] TextViewerUndoManager#undoable() always return false when used in a textListener or document listener
Summary: [implementation] TextViewerUndoManager#undoable() always return false when us...
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P4 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 221392
  Show dependency tree
 
Reported: 2008-03-06 04:52 EST by Radoslav Gerganov CLA
Modified: 2019-09-06 16:12 EDT (History)
3 users (show)

See Also:


Attachments
Simple program for reproducing the problem (1.62 KB, text/x-java)
2008-03-06 04:52 EST, Radoslav Gerganov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radoslav Gerganov CLA 2008-03-06 04:52:53 EST
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.
Comment 1 Susan McCourt CLA 2008-03-18 15:06:45 EDT
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...
Comment 2 Dani Megert CLA 2008-03-25 07:54:10 EDT
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.
Comment 3 Dani Megert CLA 2008-04-24 05:27:08 EDT
Use the key listener for now.
Comment 4 Martin Oberhuber CLA 2008-04-29 14:53:06 EDT
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...
Comment 5 Dani Megert CLA 2008-04-30 02:05:46 EDT
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.
Comment 6 Eclipse Webmaster CLA 2019-09-06 16:12:19 EDT
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.