Skip to content
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

The final quote after a string is doubled in the NetLogo Code Tab #532

Open
brandesNW opened this issue Jan 25, 2024 · 1 comment
Open

Comments

@brandesNW
Copy link

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.

  1. Build NetLogo
  2. Run NetLogo - from the NetLogo directory ./sbt, in the sbt shell netlogo/run
  3. The NetLogo GUI will open, click on the tab labeled Code.
  4. type "mystring" and the correct result "mystring" will appear
  5. exit NetLogo, do not exit sbt
  6. edit the file build.sbt, replacing the line "com.fifesoft" % "rsyntaxtextarea" % "3.3.0" with "com.fifesoft" % "rsyntaxtextarea" % "3.3.1"
  7. in sbt type netlogo/run and repeat steps 3)
  8. 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)

bad-3 3 4
good-3 3 0

@brandesNW brandesNW added the bug label Jan 25, 2024
@bobbylight
Copy link
Owner

bobbylight commented Feb 6, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants