-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Helix 23.05 (d52b7903) freezes editing markdown #7689
Comments
Please provide the file that caused this (or even better a mini.ized reproduction case). Otherwise this is not actionable |
Thanks! Sounds good but it'll take some work to anonymize or reduce. In the meantime, here's my reproduction case with hope that this may trigger someone:
I suspect this will work with HTML too though I'm not sure of the root cause given the relationship of key events to the text file's size and implied parse complexity of its tokens. I'll try to get a minimal reproduction file now that I know it doesn't take much to freeze helix. |
I believe this is the relevant log:
|
I can not reporduce with those steps (I used the helix changelog). I edit MD files very frequently so if this was easily reproducible I would have noticed. You need to provide a file. If you can minimize that would be nice but even a non-minimal file would be good. |
Hello, I got it when modifying HTML inside of a markdown file. It makes a core spin at 100% and I have to SIGKILL (-9) as SIGTERM (-15) have no effect. (Just updated my helix install to check if it was resolved in the meantime.) My steps to reproduces ain’t minimal, sorry:
I did not had a crash on my little testing if I was on the project’s parent directory or if I opened the file directly with May be of some importance, or not, my env is as follow: |
Thanks @Zykino for your effort. I was hoping that someone else would see the same pattern. I didn't have time to narrow my case but the reproduction in your git repo is almost identical: CV in markdown with embedded HTML. I actually went looking back to the conversation between Gruber and Swartz around the creation of markdown twenty years ago, but I could not find the origin of the idea superset of HTML despite numerous deep conversations over the years. I also pointed my package manager at a slightly different AUR and installed a more stable (not tip of the trunk) version and indeed, the regression disappears.
I did try the reproduction steps with the repo on this install of hx and indeed, no crash. I'll try the other version today when I get a chance. @pascalkuthe Thanks! |
thanks for the reproduction case @Zykino I was able to reproduce and trace this back. This is an upstream bug in tree-sitter (or maybe the grammar but I actually doubt that). It seems that I checked and there is nothing wrong on our end here, TS just completely freezes up at some point. |
minimal reproduction case: Select the fist <x>
<""></x> This freeze does not occur in an HTML file with the same content. |
Wow thanks for the quick feedback :) |
I am still working on a minimal reproduction case for that. The current minimal reproduction case involves helix and is too complex to report upstream. We would have to write a small rust program that uses tree sitter and libloading to parse the snippet I posted above into a syntax tree and then call |
Encountered the same kind of freeze while editing some python through markdown. Would that be related ? (remove the backslash, I couldn't format it correctly 😄 ) this is a code example in python
\`\`\`python
>>> len(data1)
577563
>>> data1[0]
{'route': '3', 'date': '01/01/2001', 'daytype': 'U', 'rides': 7354}
>>>
\`\`\`
|
reported upstream in tree-sitter/tree-sitter#2421, reason seems to be a token of length 0 generated by the markdown grammar when HTML spans multiple lines. |
CC @MDeiml the freeze seems to be caused by |
That should be possible for block continuations because their job I just to "subtract" from the inline part. Obviously subtracting something empty is not necessary. There are other empty nodes where this wouldn't be possible though, but maybe this is really just about the block continuations so I'll try. |
I checked it out, but sadly I was wrong. These computations are somewhat hacky, but not sure if theres an easy way to do this. The problem is that the state of the external scanner can only change if it emits a token. In the current implementation this is necessary sometimes without consuming any actual input. I think it's still possible to avoid empty block continuations (and maybe make stuff more efficient and clear in the process), but it's gonna take some work. |
The upstream issue has been closed thanks to a quick fix by @the-mikedavis so there shouldn't be changes to the grammar necessary @MDeiml |
Guess that should be "shouldn't"? :) |
Summary
I've been running the git release of Helix on arch for a couple years now. My current install is on Garuda Linux:
I've been editing markdown all day, every day for a while and helix started freezing recently where all keystroke processing ceases. Nothing seems to release it, esc, colon, etc.
I've taken to
pgrep hx
follwed bypkill hx
at the command line to resolve and restart helix.Reproduction Steps
I tried this:
hx
I expected this to happen:
No frezee.
Instead, this happened:
Freeze.
Helix log
I'll provide the verbose log when I get it.
~/.cache/helix/helix.log
Platform
Gaurda Linux (arch)
Terminal Emulator
fish on alacritty
Helix Version
helix 23.05 (d52b790)
The text was updated successfully, but these errors were encountered: