-
Notifications
You must be signed in to change notification settings - Fork 12
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
Bug causing memory corruption #17
Comments
In Emacs, markdown mode can open code block in another buffer with correct mode (like
It is probably not caused by the Emacs lisp code, but the parser. As a result, all the features (like syntax highlighting) gone. The tested markdown content is: ```typst-ts
``` |
I tested this with Neovim (v0.10.0-dev-530 g8376e8700) in macOS, which I use regularly, and it reproduced the problem. |
The bug seems to be broader than just related to indentation in embedded Typst code. I do get regularly a tree sitter failure stopping syntax highlighting for arbitrary simple files. I will try to pin down the problem but I need a way to reproduce it systematically. Another track I am looking at is lexer simplification. I believe the actual lexer is too complex and doesn't have to be. The problem is that it sequentially try to match available token instead of looking at the available next character and pin down the corresponding token. I will attempt a rewrite with this approach. Also, I want to migrate all tokenization to the external lexer. This would remove the need for |
It looks like with the new version of Tree Sitter, the bug has been fixed. Could someone try to reproduce it with a recent version of Tree Sitter? On my side, I could not. |
In Helix editor, when writing any file format that support embedded languages like raw blocks in markdown or typst:
It causes a segfault when the embedded Typst code contains delimited context like
_
or*
with indentation sensitive items like-
or+
.I don't know if it happens in other editors. It seems to be caused by the external scanner when it calls
lexer->get_column()
, but the segfault does not occur during this call, it occurs outside of the scanner.Could somebody try this on Helix on his machine to know if this is reproducible or not? And also test with another editor, like Neovim or Emacs.
The text was updated successfully, but these errors were encountered: