RSyntaxTextArea
RSyntaxTextArea copied to clipboard
The final quote after a string is doubled in the NetLogo Code Tab
In NetLogo a string is surrounded by double quotes: "mystring" Typing a string in the NetLogo code tab worked correctly using rsyntaxtextarea 3.3.0. We upgraded to 3.3.4 and then the same typing lead to a second final quote: "mystring"" By trying the intermediate releases I determined that this issue arose in version 3.3.1
The attached screenshots show the difference
Steps to Reproduce Reproducing this would take a lot of effort.
- Build NetLogo
- Run NetLogo - from the NetLogo directory
./sbt, in the sbt shellnetlogo/run - The NetLogo GUI will open, click on the tab labeled Code.
- type "mystring" and the correct result "mystring" will appear
- exit NetLogo, do not exit sbt
- edit the file build.sbt, replacing the line
"com.fifesoft" % "rsyntaxtextarea" % "3.3.0"with"com.fifesoft" % "rsyntaxtextarea" % "3.3.1" - in sbt type
netlogo/runand repeat steps 3) - type "mystring" and the incorrect result "mystring"" will appear
I tried to see if this happened with one of your demos, but didn't get it to work
TextEditorDemo$ javac -cp rsyntaxtextarea-3.3.0.jar TextEditorDemo.java
TextEditorDemo$ ls
TextEditorDemo.class TextEditorDemo.java rsyntaxtextarea-3.3.0.jar
TextEditorDemo$ java TextEditorDemo
Error: Unable to initialize main class TextEditorDemo
Caused by: java.lang.NoClassDefFoundError: org/fife/ui/rtextarea/RTextArea
However the relevant file seems to be there
TextEditorDemo$ jar tf rsyntaxtextarea-3.3.0.jar | grep RTextArea.class
org/fife/ui/rtextarea/RTextArea.class
Screenshots Compare the good and bad screenshots
Java version What version of Java are you running? OpenJDK 64-Bit Server VM (build 17.0.8.1+1-LTS, mixed mode, sharing)
What language/TokenMaker are you using? Looks like this?
Versaion 3.3.1 introduced features such as auto-closing of double quotes that might be contributing to this. Can you try calling textArea.=setInsertPairedCharacters(false) and see if this addresses things?
If not, do you know if your parser is identifying "mystring" as a single token of type TokenTypes.LITERAL_STRING_DOUBLE_QUOTE?