Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Feb 7, 2017

Fixes #5888

@mastrolinux mastrolinux added the in progress Work on this item is in progress label Feb 7, 2017
@facchinm facchinm added the Component: IDE user interface The Arduino IDE's user interface label Feb 7, 2017
@facchinm
Copy link
Member Author

facchinm commented Feb 8, 2017

@septillion-git can you test the binary that @ArduinoBot will produce? Thanks!

@PaulStoffregen
Copy link
Contributor

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! :-)

@facchinm
Copy link
Member Author

facchinm commented Feb 8, 2017

@matthijskooijman
Copy link
Collaborator

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 matthijskooijman removed the in progress Work on this item is in progress label Feb 8, 2017
@matthijskooijman matthijskooijman added the in progress Work on this item is in progress label Feb 8, 2017
@facchinm facchinm added this to the Release 1.8.2 milestone Feb 8, 2017
@facchinm
Copy link
Member Author

facchinm commented Feb 8, 2017

@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
Copy link

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... 🙄

@PaulStoffregen
Copy link
Contributor

I've been using it for about an hour, and so far no NPEs! :)

@PaulStoffregen
Copy link
Contributor

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.RepaintManager$4.run(RepaintManager.java:831)
at javax.swing.RepaintManager$4.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.access$1200(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.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.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)

@matthijskooijman
Copy link
Collaborator

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).

@matthijskooijman
Copy link
Collaborator

@facchinm, I cleaned up some of the undo handling in #5990, which allows updating RSTA to an unmodified version. Care to review that?

@cmaglie cmaglie mentioned this pull request Feb 27, 2017
@cmaglie
Copy link
Member

cmaglie commented Mar 1, 2017

Fixed by #6022

@cmaglie cmaglie closed this Mar 1, 2017
@mastrolinux mastrolinux removed the in progress Work on this item is in progress label Mar 1, 2017
@cmaglie cmaglie deleted the update_rsyntaxarea branch March 1, 2017 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants