-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 crashed on "Undo change" (u) [undo] #5733
Comments
A bit of a longshot but the problem maybe fixed by #5711 if your file contains any non-ascii chars. Could you try again with that PR? Otherwise please post your file with which you experienced the crash so we can reproduce and test the problem ourselfs. |
#1410 has the same panic, it seems to have to do with paste and then undo |
Any kind of incorrect transaction applied to a document can cause crashes like these. A ton of different bugs can cause incorrect transactions to be produced so the panic message doesn't tell us much about the cause. Since #1410 was reported most of these issues have been fixed (many by @the-mikedavis). So this is likely a different bug. It sounds like it's LSP related hence I suggested #5711 since I had similar crashes while testing that (before I finally fixed them all) |
I can't reproduce this with just those steps: can you reliably reproduce this with some exact clipboard contents? If you can reproduce could you capture the full backtrace by setting Also: do you have a language server installed for javascript and have you configured it to format on save? |
I think he does, from the issue description:
Which reminded me of #4791 (hence my guess that #5711 may fix this) |
I had a similar crash lately, it happened when I was pasting via middle click (and I might have been in insert mode?) then undo. It was a Go file in my case |
@pascalkuthe @the-mikedavis I'm not sure if I reproduced the same bug I had last time, since now the panic output looks different. Nevertheless, the circumstances are very similar so it's probably caused by the same issue. Some observations
Environment:
Steps to replicate(I also recorded it using asciinema).
// Make sure the mouse isn't disabled (editor.mouse in config.toml)
// Steps to reproduce:
// * Click on the last line (marked with tilde)
// * Press: <middle-click> <middle-click> <middle-click> u <middle-click> u
function test() {
return "Hello, world!";
}
thread 'main' panicked at 'Position 307 is out of range for changeset len 302!', helix-core/src/transaction.rs:397:13 stack backtrace: 0: 0x558872968465 - <unknown> 1: 0x5588720489ae - <unknown> 2: 0x558872962105 - <unknown> 3: 0x558872969de3 - <unknown> 4: 0x558872969aef - <unknown> 5: 0x55887296a4af - <unknown> 6: 0x55887296a314 - <unknown> 7: 0x55887296896c - <unknown> 8: 0x55887296a062 - <unknown> 9: 0x558871fb5e43 - <unknown> 10: 0x558872158572 - <unknown> 11: 0x558872712a8f - <unknown> 12: 0x558872714034 - <unknown> 13: 0x558872608159 - <unknown> 14: 0x55887248e646 - <unknown> 15: 0x55887248e56e - <unknown> 16: 0x558872490e5b - <unknown> 17: 0x5588725c7845 - <unknown> 18: 0x5588727afcc7 - <unknown> 19: 0x5588727d058f - <unknown> 20: 0x558872809a79 - <unknown> 21: 0x55887282aa70 - <unknown> 22: 0x5588727d1301 - <unknown> 23: 0x5588728110f3 - <unknown> 24: 0x5588728215f9 - <unknown> 25: 0x55887295d6ba - <unknown> 26: 0x5588727d1408 - <unknown> 27: 0x7f5558d05510 - __libc_start_call_main 28: 0x7f5558d055c9 - __libc_start_main@GLIBC_2.2.5 29: 0x558871ff21d5 - <unknown> 30: 0x0 - <unknown> |
Thank you so much for following up on this! I can reproduce this easily on the latest master and am looking into a fix. Detail reproduction cases like this are greatly appreciated. Not LSP related tough as this also occurs with |
turns out all paste commands don't append to history when called as a typable commands (which is a well known cause of crashes in combination with undo). Middle mouse just call |
I have managed to get a panic very similar to this issue.
Happened on an undo after a |
Summary
I had an opened JS file in helix. I accidentally pasted some text from the system clipboard several times by making a three-finger gesture swiping from right to left (the pasting action is probably due to me using tmux). I pressed 'u' to undo it and it said "Already at oldest change". After pressing Escape, I could undo the change but after pressing it a few times, Helix crashed with the error message presented in the Helix log. I may have tried writing the file with :w (don't remember exactly).
Additionally, I have the JavaScript language server running, and auto-format using prettier.
Reproduction Steps
I tried this:
tmux
hx file.js
u
<Esc>
u
a few times:w
I expected this to happen:
Changes are undone and the file is saved with formatting
Instead, this happened:
The editor has crashed.
Helix log
No related logs were recorded but the program crashed with the following error outputed to the terminal:
Platform
Linux (Fedora 37)
Terminal Emulator
alacritty 0.10.1
Helix Version
helix 22.12
The text was updated successfully, but these errors were encountered: