helix
helix copied to clipboard
Crash after using save selection -> smart tab on a new line
Summary
For context, I have made an insert mode binding of "tab" = ["save_selection", "smart_tab"] so that I can use C-o to go back if I smart tab out too many times. I have encountered this crash as described in the reproduction steps detailed below.
Reproduction Steps
- Bind
"tab" = ["save_selection", "smart_tab"]in insert mode as described above. - Open a new buffer.
- Enter either of the following key sequences:
o<tab><esc>i<ret><tab><esc>
Helix crashes with the following error message:
thread 'main' panicked at 'Positions [(2, Before)] are out of range for changeset len 1!', helix-core/src/transaction.rs:461:9
Helix log
Nothing of note was produced in the log file (with -vv).
Platform
MacOS
Terminal Emulator
iTerm2 3.5.0beta11
Helix Version
helix 23.05 (e1a9f6e0)
cc @dead10ck
Hmm, that's strange, I'll look into this. At first glance, I'm not sure how smart tab could be involved here; all it's doing is moving the cursor. I wouldn't expect it to be any different than, e.g., moving with the arrow keys.
The problem is probably save_selection not working in insert_mode. That seems like the typical "commands assume there is a revision/don't work with insert mode crash
Right, I forgot to clarify that I did test it without the save_selection binding and it didn't crash.
I encountered it twice too:
thread 'main' panicked at helix-core/src/transaction.rs:461:9:
Positions [(29740, After), (29741, Before)] are out of range for changeset len 28544!
Context for the second encounter:
- Modified a file while editing
- Opened a terminal via helix set keybinds and did
git restore path/to/file, then closed the terminal - Now back in helix, did
:reload-all+:waand proceeded to select inside a function in Insert mode (by moving line by line, holdingj) - Commented the selection (
Ctrl+c) and it crashed while commenting i think
Logs (none relevant)
2023-12-27T20:35:09.224 helix_view::editor [ERROR] Failed to initialize the language servers for `source.toml` - `taplo` { cannot find binary path }
2023-12-27T20:35:18.472 helix_view::editor [ERROR] Failed to initialize the language servers for `source.toml` - `taplo` { cannot find binary path }
2023-12-27T20:35:27.309 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(371)), original request likely timed out
I encountered it twice too:
thread 'main' panicked at helix-core/src/transaction.rs:461:9: Positions [(29740, After), (29741, Before)] are out of range for changeset len 28544!Context for the second encounter:
- Modified a file while editing
- Opened a terminal via helix set keybinds and did
git restore path/to/file, then closed the terminal- Now back in helix, did
:reload-all+:waand proceeded to select inside a function in Insert mode (by moving line by line, holdingj)- Commented the selection (
Ctrl+c) and it crashed while commenting i thinkLogs (none relevant)
That's completely ynrekated (the reproduktion cases are nothing alike). That is #6752