PreviousNextTracker indexSee it online !

(143/201) 3440409 - Painting and scrolling bug

From time to time (usually about once or twice every couple of days) I come across this bug where the textArea does not scroll to follow the cursor when it moves out of visible area, and the cursor itself is sometimes hidden.

I have not managed to reliably reproduce the bug, so I don't know how much this report is worth, but I have decided to describe the symptoms that happen to me - hopefully someone will have an idea what could be wrong.

I have been using the latest jedit builds jedit4.5pre1install.jar and now jedit5.0pre1install.jar on WinXP or Win7.

The following 6 points of description of the bug are from a single instance of it happening, the point nr. 7 is from a bug that occurred several days later:

1) The first step on a new line by arrow keys (up, down, left, right) cursor disappears, then the second step it reappears until it reaches new physical (not wrapped) line. If text is soft-wrapped, then every time the cursor jumps to a new physical line (line number changes) using up/down keys, the cursor disappears but the next press of the key the cursor reappears and stays visible, so long as it is on the same physical line (line number stays the same). In a section containing text with short lines which are not wrapped, the cursor disappears, because each up/down key press jumps to a new line, until it gets to a wrapped line, where it reappears on the second line of the wrapped physical line.

2) Status bar - line nr and offset do not update the positions when moving arrow keys, only PgDn/PgUp.

3) When cursor moves out of visible area with arrow keys, the text does not scroll with it, but PgDn or PgUp scrolls text and cursor reappears.

4) Typing the text at first only the first letter is shown, subsequent letters are not visible until space, arrow key or home/end key are pressed or mouse clicked somewhere in the text. Same for deleting characters.

5) Typing text and then choosing undo throws error:

java.lang.InternalError: Unbalanced begin/endCompoundEdit()
at org.gjt.sp.jedit.buffer.UndoManager.undo(UndoManager.java:71)
at org.gjt.sp.jedit.buffer.JEditBuffer.undo(JEditBuffer.java:2092)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.gjt.sp.jedit.bsh.Reflect.invokeMethod(Reflect.java:134)
at org.gjt.sp.jedit.bsh.Reflect.invokeObjectMethod(Reflect.java:80)
at org.gjt.sp.jedit.bsh.Name.invokeMethod(Name.java:855)
at org.gjt.sp.jedit.bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at org.gjt.sp.jedit.bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:80)
at org.gjt.sp.jedit.bsh.BshMethod.invokeImpl(BshMethod.java:362)
at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:258)
at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:186)
at org.gjt.sp.jedit.BeanShellFacade.runCachedBlock(BeanShellFacade.java:225)
at org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:423)
at org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:73)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:342)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:307)
at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:197)
at org.gjt.sp.jedit.input.AbstractInputHandler.processKeyEventKeyStrokeHandling(AbstractInputHandler.java:401)
at org.gjt.sp.jedit.gui.InputHandler.processKeyEvent(InputHandler.java:151)
at org.gjt.sp.jedit.textarea.TextArea.processKeyEvent(TextArea.java:4688)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

6) Reloading the file (built-in action) does not always help, but the following macro 'Close-reopen buffer.bsh' does (please ignore the awkward coding):

// Close-reopen buffer.bsh
Buffer currentBuffer = view.getBuffer(); // current buffer
String filePath = currentBuffer.getPath();
jEdit.openFile(view, dummy_file_path); // open dummy file
VFSManager.waitForRequests();
Buffer dummyBuffer = view.getBuffer(); // dummy buffer
VFSManager.waitForRequests();
jEdit.closeBuffer(view, currentBuffer); // close original buffer
VFSManager.waitForRequests();
jEdit.openFile(view, filePath); // reopen original buffer
VFSManager.waitForRequests();
jEdit.closeBuffer(view, dummyBuffer); // Close dummy buffer
VFSManager.waitForRequests();
jEdit.openFile(view, filePath); // Activate buffer

7) Another instance of this bug (different file and 5 days after the bug described above) happened after I cut out about half the text out of about 300 kb text file. I scrolled in the middle of the file, selected text to the beginning (CS+Home) and deleted it. The behaviour of the bug was the same as described above, but I have since activated the error(s) widget on the status bar, and there were three errors (I am not sure exactly which one is relevant to the bug).

1. error:
Typed variable declaration : Constructor error: Can't find constructor: StructureBackgroundHighlighter( org.gjt.sp.jedit.textarea.JEditTextArea ) in class: StructureBackgroundHighlighter : at Line: 91 : in file: D:\Program Files\_Editory\jEdit\startup\StructureBackgroundHighlighter.bsh : new StructureBackgroundHighlighter ( textArea )

at org.gjt.sp.jedit.bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:125)
at org.gjt.sp.jedit.bsh.BSHAllocationExpression.objectAllocation(BSHAllocationExpression.java:114)
at org.gjt.sp.jedit.bsh.BSHAllocationExpression.eval(BSHAllocationExpression.java:62)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at org.gjt.sp.jedit.bsh.BSHVariableDeclarator.eval(BSHVariableDeclarator.java:86)
at org.gjt.sp.jedit.bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:84)
at org.gjt.sp.jedit.bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:80)
at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:46)
at org.gjt.sp.jedit.bsh.BSHIfStatement.eval(BSHIfStatement.java:48)
at org.gjt.sp.jedit.bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:80)
at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:46)
at org.gjt.sp.jedit.bsh.BSHIfStatement.eval(BSHIfStatement.java:48)
at org.gjt.sp.jedit.bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:80)
at org.gjt.sp.jedit.bsh.BshMethod.invokeImpl(BshMethod.java:362)
at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:258)
at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:186)
at org.gjt.sp.jedit.bsh.This.invokeMethod(This.java:251)
at Attacher.handleMessage(BeanShell Generated via ASM (www.objectweb.org))
at org.gjt.sp.jedit.EditBus.dispatch(EditBus.java:267)
at org.gjt.sp.jedit.EditBus.sendImpl(EditBus.java:302)
at org.gjt.sp.jedit.EditBus.access$200(EditBus.java:86)
at org.gjt.sp.jedit.EditBus$SendMessage.run(EditBus.java:482)
at org.gjt.sp.jedit.EditBus.send(EditBus.java:202)
at org.gjt.sp.jedit.View.createEditPane(View.java:1973)
at org.gjt.sp.jedit.View.restoreSplitConfig(View.java:1803)
at org.gjt.sp.jedit.View.setSplitConfig(View.java:883)
at org.gjt.sp.jedit.View.<init>(View.java:1350)
at org.gjt.sp.jedit.jEdit.newView(jEdit.java:2437)
at org.gjt.sp.jedit.PerspectiveManager$PerspectiveHandler.endElement(PerspectiveManager.java:363)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.gjt.sp.util.XMLUtilities.parseXML(XMLUtilities.java:139)
at org.gjt.sp.jedit.SettingsXML.load(SettingsXML.java:155)
at org.gjt.sp.jedit.PerspectiveManager.loadPerspective(PerspectiveManager.java:107)
at org.gjt.sp.jedit.jEdit$6.run(jEdit.java:3886)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

2. error:
java.lang.NullPointerException
at org.gjt.sp.jedit.buffer.JEditBuffer.markTokens(JEditBuffer.java:1392)
at org.gjt.sp.jedit.textarea.ChunkCache.lineToChunkList(ChunkCache.java:789)
at org.gjt.sp.jedit.textarea.ChunkCache.updateChunksUpTo(ChunkCache.java:671)
at org.gjt.sp.jedit.textarea.ChunkCache.getLineInfo(ChunkCache.java:256)
at org.gjt.sp.jedit.textarea.ChunkCache.getScreenLineOfOffset(ChunkCache.java:89)
at org.gjt.sp.jedit.textarea.TextArea._finishCaretUpdate(TextArea.java:5046)
at org.gjt.sp.jedit.textarea.BufferHandler.transactionComplete(BufferHandler.java:342)
at org.gjt.sp.jedit.buffer.JEditBuffer.fireTransactionComplete(JEditBuffer.java:2573)
at org.gjt.sp.jedit.buffer.JEditBuffer.endCompoundEdit(JEditBuffer.java:2236)
at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:466)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.gjt.sp.jedit.bsh.Reflect.invokeMethod(Reflect.java:134)
at org.gjt.sp.jedit.bsh.Reflect.invokeObjectMethod(Reflect.java:80)
at org.gjt.sp.jedit.bsh.BSHPrimarySuffix.doName(BSHPrimarySuffix.java:175)
at org.gjt.sp.jedit.bsh.BSHPrimarySuffix.doSuffix(BSHPrimarySuffix.java:119)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:80)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at org.gjt.sp.jedit.bsh.Interpreter.eval(Interpreter.java:644)
at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:331)
at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:279)
at org.gjt.sp.jedit.BeanShell.runScript(BeanShell.java:205)
at org.gjt.sp.jedit.Macros$BeanShellHandler.runMacro(Macros.java:1040)
at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:462)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:342)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:307)
at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:197)
at org.gjt.sp.jedit.input.AbstractInputHandler.processKeyEventKeyStrokeHandling(AbstractInputHandler.java:401)
at org.gjt.sp.jedit.gui.InputHandler.processKeyEvent(InputHandler.java:151)
at org.gjt.sp.jedit.textarea.TextArea.processKeyEvent(TextArea.java:4695)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

3. error:
java.lang.Exception: Unbalanced begin/endCompoundEdit()
at org.gjt.sp.jedit.buffer.UndoManager.endCompoundEdit(UndoManager.java:134)
at org.gjt.sp.jedit.buffer.JEditBuffer.endCompoundEdit(JEditBuffer.java:2233)
at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:466)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:342)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:307)
at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:197)
at org.gjt.sp.jedit.input.AbstractInputHandler.processKeyEventKeyStrokeHandling(AbstractInputHandler.java:401)
at org.gjt.sp.jedit.gui.InputHandler.processKeyEvent(InputHandler.java:151)
at org.gjt.sp.jedit.textarea.TextArea.processKeyEvent(TextArea.java:4695)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Regards, tvojeho

Submitted tvojeho - 2011-11-20 - 09:24:37z Assigned nobody
Priority 5 Category editor core
Status Open Group None
Resolution None Visibility No

Comments

Attachments