usagi-flow / evil-helix

Bringing the Helix editor to the evil side
https://github.com/usagi-flow/helix
Mozilla Public License 2.0
280 stars 7 forks source link

editor panic appending empty line #30

Closed lxl66566 closed 3 months ago

lxl66566 commented 3 months ago

Summary

thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.1/src/slice.rs:360:41:
called `Result::unwrap()` on an `Err` value: Char index out of bounds: char index 18446744073709551614, Rope/RopeSlice char length 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Reproduction Steps

hx x (to remove the first line) a (to append)

helix official has the better dealing: with the first line removed, press aa or ii to go to insert mode and recover the first line.

Helix log

No response

Platform

Linux

Terminal Emulator

konsole

Installation Method

aur

Helix Version

evil-helix 24.3 (d2a3d78b)

lxl66566 commented 3 months ago

That might has been fixed in #23 ?

lxl66566 commented 3 months ago

That might has been fixed in #23 ?

no, i compiled the latest commit version (#db71fed2), and the panic still happens.

usagi-flow commented 3 months ago

Thank you for the report! I initially also wondered why #23 didn't fix this...

I'll see if I can prepare a few more changes so I can create a release this weekend.