-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Update rsyntaxarea to 2.6.1 #5960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@septillion-git can you test the binary that @ArduinoBot will produce? Thanks!
Oh good, so glad you're updating. I've been seeing occasional NPEs while working in external editor mode. The stack trace usually indicates stuff deep within rsyntaxarea. Hope this improves the situation! :-)
@ArduinoBot this time built the IDE but failed publishing its stuff 😢
Links below
✅ Build completed.
Please test this code using one of the following:
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-5960-BUILD-646-linux32.tar.xz
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-5960-BUILD-646-linux64.tar.xz
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-5960-BUILD-646-windows.zip
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-5960-BUILD-646-macosx.zip
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-5960-BUILD-646-linuxarm.tar.xz
i️ The linuxarm
build is still experimental and may not be always available.
I recall that some earlier cleanups removed the need for an Arduino-specific version of RSTA (though that might have been in my local copy only, it's been a while). Did you happen to try with the upstream version? I can probably find some time tomorrow to figure out the status of this as well.
@matthijskooijman you are correct, I backported @ffissore's patch here https://github.com/arduino/RSyntaxTextArea/tree/2.6.1.1+arduino so the jar is generated from that tree
septillion-git
commented
Feb 8, 2017
Look like it's fixed 😀
Only thing I notice is that a highlighted word stays highlighted when the line becomes a comment but that's something all comments have. But yeah, variable/function highlighting is to damn slow to be useful anyway in my opinion... 🙄
I've been using it for about an hour, and so far no NPEs! :)
Oh, looks like I spoke too soon. Just got a NPE while in external editor mode.
Please do not hold up this PR. But here's the NPE...
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.fife.ui.rsyntaxtextarea.TokenMakerBase.addToken(TokenMakerBase.java:136)
at processing.app.syntax.SketchTokenMaker.addToken(SketchTokenMaker.java:73)
at org.fife.ui.rsyntaxtextarea.TokenMakerBase.addToken(TokenMakerBase.java:110)
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.addToken(CPlusPlusTokenMaker.java:1868)
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.addToken(CPlusPlusTokenMaker.java:1852)
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.addToken(CPlusPlusTokenMaker.java:1841)
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.yylex(CPlusPlusTokenMaker.java:2271)
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.getTokenList(CPlusPlusTokenMaker.java:1919)
at org.fife.ui.rsyntaxtextarea.RSyntaxDocument.getTokenListForLine(RSyntaxDocument.java:431)
at org.fife.ui.rsyntaxtextarea.SyntaxView.paint(SyntaxView.java:728)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
at org.fife.ui.rtextarea.RTextAreaUI.paintSafely(RTextAreaUI.java:539)
at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
at org.fife.ui.rtextarea.RTextAreaBase.paintComponent(RTextAreaBase.java:735)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.paintComponent(RSyntaxTextArea.java:2072)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:306)
at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
at javax.swing.RepaintManager4ドル.run(RepaintManager.java:831)
at javax.swing.RepaintManager4ドル.run(RepaintManager.java:814)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
at javax.swing.RepaintManager.access1200ドル(RepaintManager.java:64)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access500ドル(EventQueue.java:97)
at java.awt.EventQueue3ドル.run(EventQueue.java:709)
at java.awt.EventQueue3ドル.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
I had a look around in my local repo and found an "undo" branch with a small cleanup that removes the need for RTextArea.setUndoManager()
. From my comments I thought that was sufficient for using the unmodified RSTA version, but now I see that getUndoManager()
is also used. I had a look to see if that can also be avoided (by using RSTA's action objects instead of creating and manipulating our own) and I think that it is possible, though I haven't tested it properly yet, and it needs some less than elegant code I believe (to make the RSTA actions work even when the RSTA is not focused).
A more thorough cleanup could move all actions to the RSTA ones (instead of just undo/redo), but I haven't tried that yet (and not all actions are configured in the same way, it seems).
Fixed by #6022
Fixes #5888