|The problem of StructuredTextViewerUndoManager [message #172937]
||Tue, 04 July 2006 16:28
Originally posted by: eric_suen_cn.yahoo.com.cn|
I have code like this:
// model is an instanceof IStructuredModel
I expect it will generate one CompoundCommand, but not works, because
StructuredTextViewerUndoManager.UndoNotifier listen selection event of
the TextViewer. if any selection changed, it will call the method
forceEndOfPendingCommand of class IStructuredTextUndoManager. If you
take a look of org.eclipse.jface.text.TextViewerUndoManager, you will
see it listen to the key and mouse event instead of selection event.
In StructuredTextViewer, if you typing some text then move cursor to
other offset then move back, then keep typing, it only generate one
command, but if you typing some text then change the selection then
move cursor back, then keep typing, it will generate tow undo command.
IMO, it is kind weird.
So, is it possible that my previous code only generate one command?
otherwise, this beginRecording, endRecording are totally useless...
Powered by FUDForum
. Page generated in 0.02109 seconds