Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic when Ctrl-O targets outside of buffer #3879

Closed
sshilovsky opened this issue Sep 17, 2022 · 1 comment
Closed

panic when Ctrl-O targets outside of buffer #3879

sshilovsky opened this issue Sep 17, 2022 · 1 comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue

Comments

@sshilovsky
Copy link

sshilovsky commented Sep 17, 2022

Summary

Ctrl-O panics if target position is out of buffer bounds

Reproduction Steps

  1. open new file
  2. create content:
1234567890
  1. from normal mode, type sequence: gggl Ctrl+S ghddd Ctrl+O
  2. observe panic message

Helix log

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Char index out of bounds: char index 12, Rope/RopeSlice char length 9', /home/sh/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ropey-1.5.0/src/slice.rs:349:41
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
   2: core::result::unwrap_failed
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/result.rs:1785:5
   3: ropey::slice::RopeSlice::char_to_byte
   4: helix_core::graphemes::nth_prev_grapheme_boundary
   5: helix_core::selection::Range::grapheme_aligned
   6: helix_core::selection::Selection::ensure_invariants
   7: helix_view::document::Document::set_selection
   8: helix_term::commands::jump_backward
   9: helix_term::ui::editor::EditorView::handle_keymap_event::{{closure}}
  10: helix_term::ui::editor::EditorView::handle_keymap_event
  11: <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event
  12: helix_term::compositor::Compositor::handle_event
  13: helix_term::application::Application::handle_terminal_events
  14: helix_term::application::Application::event_loop_until_idle::{{closure}}
  15: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  16: std::thread::local::LocalKey<T>::with
  17: tokio::park::thread::CachedParkThread::block_on
  18: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
  19: tokio::runtime::Runtime::block_on
  20: hx::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Platform

Linux

Terminal Emulator

alacritty 0.10.1 ()

Helix Version

helix 22.08.1 (43b31f7)

@sshilovsky sshilovsky added the C-bug Category: This is a bug label Sep 17, 2022
@the-mikedavis
Copy link
Member

Duplicate of #2489

@the-mikedavis the-mikedavis marked this as a duplicate of #2489 Sep 17, 2022
@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2022
@the-mikedavis the-mikedavis added the R-duplicate Duplicated issue: please refer to the linked issue label Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue
Projects
None yet
Development

No branches or pull requests

2 participants