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

Helix crashes when using search mode across windows #8117

Closed
AccessViolation95 opened this issue Aug 30, 2023 · 1 comment
Closed

Helix crashes when using search mode across windows #8117

AccessViolation95 opened this issue Aug 30, 2023 · 1 comment
Labels
C-bug Category: This is a bug

Comments

@AccessViolation95
Copy link

Summary

When using vnew to vertically split the screen, creating a new window, then searching for something in that window with / which causes matching text to be selected, not pressing enter, and then switching focus to the other window and pressing backspace, Helix panics.

Reproduction Steps

I tried this:

  1. hx
  2. :vnew
  3. :tutor (I've verified it works with any text, but just using tutor is easier to follow for this report)
  4. /align (Search for text that appears in the window, it can be anything so long as it causes text to be selected. Note that I'm not pressing enter).
  5. [left mouse button click on the empty original window on the left]
  6. backspace

I expected this to happen:
A character is removed from the searched-for text.

Instead, this happened:
Helix panics with this:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Byte index out of bounds: byte index 19267, Rope/RopeSlice byte length 1', /build/helix-4G9og3/helix-23.05/vendor/ropey/src/slice.rs:324:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Helix log

~/.cache/helix/helix.log
2023-08-30T16:13:11.844 helix_view::clipboard [DEBUG] Using xclip to interact with the system and selection (primary) clipboard
2023-08-30T16:13:11.845 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 149.191µs)
2023-08-30T16:13:11.845 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:12.246 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-30T16:13:13.881 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:14.282 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-30T16:13:14.512 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:14.670 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:14.773 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:14.912 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:15.917 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:15.917 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:16.327 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:16.327 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:16.596 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:16.596 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:16.728 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-30T16:13:16.774 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:16.774 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:16.885 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:16.885 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:17.057 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:17.057 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:17.155 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:17.155 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:17.684 helix_vcs [INFO] Error {
    context: "failed to open git repo",
    source: Discover(
        NoGitRepository {
            path: "/var/lib/helix/runtime",
        },
    ),
}
2023-08-30T16:13:17.684 helix_vcs [INFO] failed to open diff base for /var/lib/helix/runtime/tutor
2023-08-30T16:13:17.684 helix_vcs [INFO] Error {
    context: "failed to open git repo",
    source: Discover(
        NoGitRepository {
            path: "/var/lib/helix/runtime",
        },
    ),
}
2023-08-30T16:13:17.684 helix_vcs [INFO] failed to obtain current head name for /var/lib/helix/runtime/tutor
2023-08-30T16:13:17.684 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-08-30T16:13:17.685 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:17.685 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:18.758 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:18.758 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:18.969 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:18.969 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:19.159 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-30T16:13:19.229 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:19.229 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:19.306 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:19.306 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:19.529 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:19.529 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:19.605 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:19.605 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:20.724 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-30T16:13:20.724 helix_view::document [DEBUG] id 3 modified - last saved: 0, current: 0
2023-08-30T16:13:21.305 helix_term::application [DEBUG] received editor event: IdleTimer

Platform

Linux

Terminal Emulator

alacritty 0.12.2

Helix Version

helix 23.05 (7f5940b)

@AccessViolation95 AccessViolation95 added the C-bug Category: This is a bug label Aug 30, 2023
@pascalkuthe
Copy link
Member

Yeah clicking on a different view is the problem. This bug that is currently blocked on #5581.

Duplicate of #5632

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
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
Projects
None yet
Development

No branches or pull requests

2 participants