ox
ox copied to clipboard
Crash when pressing backspace at the start of the first line due to subtraction overflow
Describe the bug The editor crashes when pressing backspace at the start of the first line. Message: panicked at src/editor.rs:603:13: attempt to subtract with overflow
To Reproduce Steps to reproduce the behavior:
- Press backspace at the start of the first line.
Expected behavior Nothing
Desktop (please complete the following information):
- OS: Linux
Solution c.saturating_sub(1);
Cannot reproduce on Fedora 40, using freshly compiled ox from git sources.
Thanks for raising this issue, it's strange as just like @bitfl0wer mentioned, I can't seem to reproduce this either, but thanks to the work of @cedricbuild, it should hopefully no longer cause any issues