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

Syntax highlighting can sometimes skip regions in large projects #947

Open
Auroriax opened this issue Dec 5, 2022 · 3 comments
Open

Syntax highlighting can sometimes skip regions in large projects #947

Auroriax opened this issue Dec 5, 2022 · 3 comments

Comments

@Auroriax
Copy link

Auroriax commented Dec 5, 2022

If you open a large PuzzleScript project (~1000 lines or more) in the editor, then if you scroll quickly (e.g. by dragging the scroll bar), then you can run into cases where the syntax highlighting does not work correctly for a region of code. This can also cause you to be unable to do some things, like Ctrl+Clicking levels.

I originally noted this on my PS fork, as projects there usually cover more lines than a normal PuzzleScript project. However, this can be reproduced in the PuzzleScript editor as well.

Screenshot_10
108115055-e2a98600-7099-11eb-8a12-a2feadd70e87

@Auroriax Auroriax changed the title Syntax highlighting can fail for large projects Syntax highlighting can sometimes skip regions in large projects Dec 5, 2022
@increpare
Copy link
Owner

Thanks for the report. Any console errors or the like when this happens?

Thinking aloud to myself - I guess the best possibility here is to try upgrade the codemirror version (but not to the super new one that would need a whole rewrite because it has a different parsing system). I need to be careful because I've made some minor under-the-hood changes to codemirror.js directly, but hmm!

@Auroriax
Copy link
Author

Auroriax commented Dec 8, 2022

Sadly, there don't seem to be any errors reported to the console when this happens, in both Chrome and Firefox. Chrome seems to report a couple of violations:

[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.ch40mestatus.qjz9zk/feature/5745543795965952
S.on @ codemirror.js:6705
(anonymous) @ codemirror.js:2345
S @ codemirror.js:97
S @ codemirror.js:62
S.fromTextArea @ codemirror.js:4679
(anonymous) @ editor.js:82
[Violation] Forced reflow while executing JavaScript took 59ms
rng.js:20 [Violation] 'setTimeout' handler took 93ms
rng.js:20 [Violation] 'setTimeout' handler took 101ms
rng.js:20 [Violation] 'setTimeout' handler took 113ms

So nothing super interesting, it seems!

@increpare
Copy link
Owner

increpare commented Dec 9, 2022 via email

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

No branches or pull requests

2 participants