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 with multiple selection in long line when hitting enter in insert mode #12626

Closed
peter9477 opened this issue Jan 21, 2025 · 4 comments
Closed
Labels
C-bug Category: This is a bug

Comments

@peter9477
Copy link

peter9477 commented Jan 21, 2025

tempx.txt

Summary

With the attached file when I try multiselecting all text DEBUG, switch to insert mode and hit Enter helix panics in ropey-1.6.1.

Note: md5sum of attached file is ad25ba989d3281257b72181902f3b9dc

Reproduction Steps

I tried this:

  1. hx tempx.txt (the attached file)
  2. %sDEBUG to select all instances of DEBUG in the line
  3. <Enter>i<Enter>

I expected this to happen: split the line into 3

Instead, this happened:

thread 'main' panicked at /home/username/.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 212, Rope/RopeSlice char length 187
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Helix log

~/.cache/helix/helix.log
Nothing is added to the log file when I do this.  (If I 'rm' the log and reproduce the crash the log is created, zero length.)

Platform

Debian 12 via WSL2

Terminal Emulator

WSL2

Installation Method

Built with cargo build -r

Helix Version

helix 25.1 (dabfb6c)

@peter9477 peter9477 added the C-bug Category: This is a bug label Jan 21, 2025
@peter9477
Copy link
Author

peter9477 commented Jan 21, 2025

This may be the same as #10497 but the exact message is different so maybe not. (Upon reading further I see later comments in that issue with the same error message, so these are the same, but as mine has a 100% reproduction I'll leave it to others to decide how to handle this one.)

@nik-rev
Copy link
Contributor

nik-rev commented Jan 21, 2025

Try the latest releat 25.01.1 where this should be fixed

@the-mikedavis
Copy link
Member

Yep this looks like a duplicate of #12495 and should be fixed in the 25.01.1 release

@peter9477
Copy link
Author

Try the latest releat 25.01.1 where this should be fixed

Confirmed! Thank you.

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

3 participants