helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
34.05k stars 2.52k forks source link

[Low Priority] Panic if opening large amounts of files with `--vsplit` and `--hsplit` #12158

Open NikitaRevenco opened 1 day ago

NikitaRevenco commented 1 day ago

When we try open 200 files in a split:

hx --vsplit {1..200}

Helix will panic with the following message:

thread 'main' panicked at helix-tui/src/buffer.rs:516:21:
index out of bounds: the len is 4788 but the index is 4788
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

There should be some kind of error message when trying to pass a large number to --vsplit and --hsplit

kirawi commented 1 day ago

https://github.com/helix-editor/helix/pull/4642