Auroriax / PuzzleScriptPlus

Puzzlescript Plus: Open Source HTML5 Puzzle Game Engine (with lots of extra functionality)
https://auroriax.github.io/PuzzleScript/
34 stars 4 forks source link

Syntax highlighting can get weird for big projects #1

Closed Auroriax closed 1 year ago

Auroriax commented 3 years ago

It seems that if you scroll too quickly the syntax highlighting can get weird & can cause ctrl+clicking a level to crash in some cases:

afbeelding

Could it break because I changed the syntax highlighing code?

Auroriax commented 3 years ago

Not 100% sure, but my hunch is that it might have something to do with how the > character is escaped in the puzzlescript source code that can confuse the parser. I should probably replace the > with another glyph that's escape-safe, like a special instruction such as copy:.

Auroriax commented 3 years ago

So it seems that PS syntax highlighting is prone to break on projects that have a very large source code (e.g. Gridblocked), it seems most people with gargantuan PS source code (e.g. Selene's Garden) don't use the editor to edit code because it's prone to breaking. So it could be a CodeMirror issue. Might be worth it to bring this up with increpare?

As for the editor crashing, seems it could've been a stuck for loop or a memory overflow... I don't have enough info to go on to fix it.

Auroriax commented 2 years ago

This has become a messy issue. To summarize:

  1. One issue is that the editor crashes sometimes. However, I know very little about the conditions of the crash, so I can't reproduce it. I do think they were looking at the Gridblocked code which is mouse-supported, for which I've just resolved a crash, so I think this issue is now resolved (since I don't have a touchscreen-enabled laptop to test it).
  2. The syntax highlighting issue seems to be a vanilla PS bug. However, source code for PS+ projects is usually larger that for vanilla projects, which increases the chance of running into this bug. I still want to make a repro case and log it by increpare.
Auroriax commented 1 year ago

Reported to increpare as https://github.com/increpare/PuzzleScript/issues/947. Closing here.