ox icon indicating copy to clipboard operation
ox copied to clipboard

Crash when pressing backspace at the start of the first line due to subtraction overflow

Open Lord-Vlad opened this issue 1 year ago • 1 comments

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:

  1. 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);

Lord-Vlad avatar Aug 05 '24 15:08 Lord-Vlad

Cannot reproduce on Fedora 40, using freshly compiled ox from git sources.

bitfl0wer avatar Aug 19 '24 14:08 bitfl0wer

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

curlpipe avatar Sep 03 '24 17:09 curlpipe