I've had this problem off and on, but now have a reproducible test case:

1. Open jEdit.  I have a large number of buffers open from previoius session.
2. Call jEdit from command line to open a previously unopen file (i.e. a new file to work on).
3. Choose File|Save As... and give file a new name.
4. Move somewhere in middle of buffer.
5. Use delete lines macro several times (Edit|Text|Delete Lines)
6. Attempt undo (Edit|Undo)

Buffer view is trashed (not properly redrawn) and error dialog appears.  I've included the jEdit log for reference.  Any thoughts as to what my next steps should be?  I'm a bit confused by the actual failure as Delete Lines is a built-in function rather than my rather poor attempts to create my own.


1:37:02 PM [main] [message] Log: When reporting bugs, please include the following information:
1:37:02 PM [main] [message] Log: java.version=1.6.0_22
1:37:02 PM [main] [message] Log: java.vm.version=17.1-b03
1:37:02 PM [main] [message] Log: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
1:37:02 PM [main] [message] Log: java.runtime.version=1.6.0_22-b04
1:37:02 PM [main] [message] Log: java.runtime.name=Java(TM) SE Runtime Environment
1:37:02 PM [main] [message] Log: java.vendor=Sun Microsystems Inc.
1:37:02 PM [main] [message] Log: java.compiler=null
1:37:02 PM [main] [message] Log: os.name=Windows 7
1:37:02 PM [main] [message] Log: os.version=6.1
1:37:02 PM [main] [message] Log: os.arch=amd64
1:37:02 PM [main] [message] Log: user.home=C:\Users\mzaleski
1:37:02 PM [main] [message] Log: java.home=C:\Program Files\Java\jre1.6.0_22
1:37:02 PM [main] [message] Log: java.class.path=C:\Program Files\jEdit\jedit.jar
1:37:02 PM [main] [message] jEdit: starting with command line arguments: -reuseview



1:39:35 PM [jEdit I/O #2] [debug] WorkThread: Running in work thread: [id=11,run=org.gjt.sp.jedit.bufferio.BufferSaveRequest[Report.m (C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\)]]
1:39:35 PM [AWT-EventQueue-0] [debug] EditBus: BufferUpdate[what=PROPERTIES_CHANGED,view=null,source=Report1.m (C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\)]
1:39:35 PM [AWT-EventQueue-0] [debug] EditBus: BufferUpdate[what=DIRTY_CHANGED,view=org.gjt.sp.jedit.View[active],source=Report1.m (C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\)]
1:39:35 PM [AWT-EventQueue-0] [debug] EditBus: BufferUpdate[what=SAVED,view=org.gjt.sp.jedit.View[active],source=Report1.m (C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\)]
1:39:35 PM [AWT-EventQueue-0] [debug] EditBus: VFSUpdate[path=C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR,source=null]
1:39:35 PM [AWT-EventQueue-0] [debug] EditBus: VFSUpdate[path=C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\#Report1.m#save#,source=null]
1:39:35 PM [AWT-EventQueue-0] [debug] EditBus: VFSUpdate[path=C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\Report1.m,source=null]
1:39:35 PM [AWT-EventQueue-0] [debug] EditBus: DynamicMenuChanged[menu=recent-files,source=null]
1:39:37 PM [AWT-EventQueue-0] [debug] EditBus: PositionChanging[what=POSITION_CHANGING,source=org.gjt.sp.jedit.EditPane[active]]
1:39:38 PM [AWT-EventQueue-0] [debug] EditBus: BufferUpdate[what=DIRTY_CHANGED,view=null,source=Report1.m (C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\)]
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction: java.lang.InternalError: Unbalanced begin/endCompoundEdit()
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.buffer.UndoManager.undo(UndoManager.java:71)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.buffer.JEditBuffer.undo(JEditBuffer.java:2092)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.lang.reflect.Method.invoke(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.Reflect.invokeMethod(Reflect.java:134)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.Reflect.invokeObjectMethod(Reflect.java:80)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.Name.invokeMethod(Name.java:855)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BSHBlock.evalBlock(BSHBlock.java:130)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:80)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BshMethod.invokeImpl(BshMethod.java:362)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:258)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:186)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.BeanShellFacade.runCachedBlock(BeanShellFacade.java:225)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:423)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:73)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:342)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:307)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:197)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.input.AbstractInputHandler.processKeyEventKeyStrokeHandling(AbstractInputHandler.java:401)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.gui.InputHandler.processKeyEvent(InputHandler.java:151)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at org.gjt.sp.jedit.textarea.TextArea.processKeyEvent(TextArea.java:4711)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Component.processEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Container.processEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Component.dispatchEventImpl(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Container.dispatchEventImpl(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Component.dispatchEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Component.dispatchEventImpl(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Container.dispatchEventImpl(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Window.dispatchEventImpl(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.Component.dispatchEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.EventQueue.dispatchEvent(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:39:47 PM [AWT-EventQueue-0] [error] BeanShellAction:  at java.awt.EventDispatchThread.run(Unknown Source)
1:40:02 PM [AWT-EventQueue-0] [debug] EditBus: DynamicMenuChanged[menu=recent-files,source=null]
1:40:03 PM [jEdit I/O #1] [debug] WorkThread: Running in work thread: [id=14,run=org.gjt.sp.jedit.bufferio.BufferAutosaveRequest[Report1.m (C:\vehdyn_toolbox\R2011b\VehDyn.mks\CR\@vdCR\)]]
1:40:37 PM [AWT-EventQueue-0] [debug] EditBus: DockableWindowUpdate[what=ACTIVATED,dockable=log-viewer,source=org.gjt.sp.jedit.gui.DockableWindowManagerImpl[,0,0,1331x851,layout=org.gjt.sp.jedit.gui.DockableLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.synth.SynthBorder@6d7ffbf,flags=9,maximumSize=,minimumSize=,preferredSize=]]
1:41:03 PM [AWT-EventQueue-0] [debug] EditBus: DynamicMenuChanged[menu=recent-files,source=null]