cvs -q diff -u -N editor/ Index: editor/libsrc/org/netbeans/editor/BaseDocumentEvent.java =================================================================== RCS file: /cvs/editor/libsrc/org/netbeans/editor/BaseDocumentEvent.java,v retrieving revision 1.24.40.2 diff -u -r1.24.40.2 BaseDocumentEvent.java --- editor/libsrc/org/netbeans/editor/BaseDocumentEvent.java 8 Sep 2006 14:45:52 -0000 1.24.40.2 +++ editor/libsrc/org/netbeans/editor/BaseDocumentEvent.java 15 Sep 2006 12:33:59 -0000 @@ -43,6 +43,10 @@ private static final boolean debugUndo = Boolean.getBoolean("netbeans.debug.editor.document.undo"); + + private static int lastId; + + private int id; private DocumentContent.Edit modifyUndoEdit; @@ -97,6 +101,16 @@ hasBeenDone2 = true; alive2 = true; inProgress2 = true; + id = lastId++; + System.err.println("CREATED id=" + id + ", type=" + type + ", offset=" + offset + ", length=" + length); + if (type == DocumentEvent.EventType.REMOVE) { + try { + String text = doc.getText(offset, length); + if (text.length() < 80) { + System.err.println(" removed text='" + text + "'"); + } + } catch (BadLocationException e) { } + } } protected UndoableEdit findEdit(Class editClass) { @@ -228,6 +242,7 @@ } public void undo() throws CannotUndoException { + System.err.println("UNDO of id=" + id); BaseDocument doc = (BaseDocument)getDocument(); inUndo = true; @@ -279,13 +294,16 @@ // End super of undo() if (previous != null) { + System.err.println(" UNDO of id=" + ((BaseDocumentEvent)previous).id + " after this undo ..."); previous.undo(); } inUndo = false; + System.err.println(" UNDO of id=" + id + " finished"); } public void redo() throws CannotRedoException { + System.err.println("REDO of id=" + id); BaseDocument doc = (BaseDocument)getDocument(); boolean notifyMod; try { @@ -296,6 +314,7 @@ inRedo = true; if (previous != null) { + System.err.println(" REDO of id=" + ((BaseDocumentEvent)previous).id + " before this redo ..."); previous.redo(); } @@ -339,6 +358,7 @@ // End super of redo() inRedo = false; + System.err.println(" REDO of id=" + id + " finished"); } public boolean addEdit(UndoableEdit anEdit) {