Open snowp opened 9 years ago
Thanks for the report! Will try get this fixed asap!
This doesn't crash anymore, however C-e
does nothing at all when you are on a line without a newline at the end of it.
I have a partial fix here.
The cursor seems to get displayed one char after where it should be, but the actual insertion point is correct.
@crespyl looks good!
Wanna open a pull request? :)
The editor crashes due to a rust_panic caused by an out of bounds access on a
Vec
whenever move-beginning-of-line (C-a) or move-end-of-line (C-e) is used in a buffer with no newlines.The issue seems to be with buffer.rs in
get_line_index_backward
andget_line_index_forward
:nlines
is an emptyVec
when the buffer contains no newlines. The subsequent access tonlines[offset]
on line 275 and 334 causes the panics.