-
-
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
Rust panics when terminal is too small #1403
Comments
😅 helix/helix-term/src/ui/picker.rs Lines 507 to 508 in bcf3808
Should be as simple as std::cmp::max(1, (row as usize) * (rows as usize))
|
Found another panic.
Edit: Nevermind, looks like a propagated panic from the same source issue, |
Yeah that looks right. |
(The original panic was a divide by 0 panic on line 508) |
The div by 0 is not the only issue: The I think it would be safer and more idiomatic to return Option and implement Line 165 in a066f59
Another solution would be to always perform the bounds checks and to return a dummy Cell when out of bounds. I dislike this one. |
When the terminal gets too small to fit some widget, helix crashes.
Reproduction steps
<space> f
)Stumbled upon this bug when using hx in a drop-down terminal, which apparently resizes the window when hidden.
Environment
gnome-terminal
)The text was updated successfully, but these errors were encountered: