x at the last line produces a panic
Closed this issue · 2 comments
antoyo commented
Summary
Pressing x
on the last line will produce the following panic:
thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.1/src/slice.rs:656:9:
Attempt to slice past end of RopeSlice: slice end 2, RopeSlice length 1
stack backtrace:
0: rust_begin_unwind
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
1: core::panicking::panic_fmt
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
2: ropey::slice::RopeSlice::slice
3: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
4: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
5: helix_term::commands::evil::EvilCommands::yank_selection
6: helix_term::commands::evil::EvilCommands::delete_selection
7: helix_term::commands::evil::EvilCommands::delete_immediate
8: helix_term::ui::editor::EditorView::handle_keymap_event::{{closure}}
9: helix_term::ui::editor::EditorView::handle_keymap_event
10: <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event
11: helix_term::compositor::Compositor::handle_event
12: helix_term::application::Application::run::{{closure}}
13: tokio::runtime::park::CachedParkThread::block_on
14: hx::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Reproduction Steps
I tried this:
hx
j
to go to the last line.x
I expected this to happen:
Not panicking.
Instead, this happened:
It panicked.
Helix log
No response
Platform
Linux
Terminal Emulator
Alacritty
Installation Method
Source
Helix Version
evil-helix 24.3 (d969d50)
usagi-flow commented
Thank you very much for your report, this would also be caused when appending (a
) while at the EOF.
antoyo commented
Thanks for your fixes!