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 yank and past from right to left window of the same file #4600

Closed
getreu opened this issue Nov 5, 2022 · 4 comments · Fixed by #4733
Closed

Panic when yank and past from right to left window of the same file #4600

getreu opened this issue Nov 5, 2022 · 4 comments · Fixed by #4733
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@getreu
Copy link
Contributor

getreu commented Nov 5, 2022

My Helix version is compiled from commit:

commit 38149872989477f62222ce68dc32d2d6018ae165 (HEAD -> master, origin/master, origin/HEAD)
Author: Michael Davis <[email protected]>
Date:   Fri Nov 4 11:04:16 2022 -0500

    Fix panic on paste from blackhole register (#4497)

Panic when yank and past from right to left window of the same file

thread 'main' panicked at 'Position 21270 is out of range for changeset len 20356!', helix-core/src/transaction.rs:397:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@the-mikedavis the-mikedavis added C-bug Category: This is a bug A-helix-term Area: Helix term improvements labels Nov 5, 2022
@David-Else
Copy link
Contributor

David-Else commented Nov 5, 2022

I tried the same thing and it worked with no panic, can you provide a step-by-step repeatable way to get this panic?

@emilyyyylime
Copy link
Contributor

Also it'd be useful if you could reproduce the issue with the RUST_BACKTRACE=1 environment variable and share the outputted backtrace

@getreu
Copy link
Contributor Author

getreu commented Nov 9, 2022

Sorry, I can not reproduce it reliably. But it proves, that this assertion is wrong in some (edge) cases:

        if pos > old_pos {
            panic!(
                "Position {} is out of range for changeset len {}!",
                pos, old_pos
            )
        }

@archseer
Copy link
Member

Finally caught a backtrace:

thread 'main' panicked at 'Position 4914 is out of range for changeset len 4842!', helix-core/src/transaction.rs:397:13
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: helix_core::transaction::ChangeSet::map_pos
   3: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
   4: helix_core::selection::Selection::map
   5: helix_view::view::View::apply
   6: helix_term::commands::paste_impl
   7: helix_term::commands::paste
   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::handle_terminal_events
  13: hx::main_impl::{{closure}}
  14: std::thread::local::LocalKey<T>::with
  15: tokio::park::thread::CachedParkThread::block_on
  16: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
  17: tokio::runtime::Runtime::block_on
  18: hx::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants