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 wile using <C-a> <C-x> on mulitple lines #5464

Closed
lexeyOK opened this issue Jan 9, 2023 · 2 comments
Closed

panic wile using <C-a> <C-x> on mulitple lines #5464

lexeyOK opened this issue Jan 9, 2023 · 2 comments
Labels
A-core Area: Helix core improvements C-bug Category: This is a bug

Comments

@lexeyOK
Copy link

lexeyOK commented Jan 9, 2023

Summary

hx will panic if you decrement 10 to 9 on long enough promt
image

Reproduction Steps

https://asciinema.org/a/dPcMiojvfzk5X1Kt6EFfFVvPw using hx binary
https://asciinema.org/a/pACZkuCee8fOc0k9pm9OyEE4W using cargo r
I tried this:

  1. hx
  2. y5p:1<CR>5Cisomething[0<ESC>h10<C-a><C-x> (make 6 lines, write something[0] on each, select 0 on each line, increment till 10, decrement)

I expected this to happen:
6 lines with something[9] writen in them
Instead, this happened:
paniced with

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Char index out of bounds: char index 80, 
Rope/RopeSlice char length 78', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ropey-1.5.1-alpha/src/slice.rs:360:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

and

thread 'main' panicked at 'assertion failed: char_idx <= slice.len_chars()', helix-core/src/graphemes.rs:85:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Helix log

only log related to recent openting

~/.cache/helix/helix.log
...
2023-01-09T15:33:41.605 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["[scratch]"]
2023-01-09T15:33:44.412 helix_view::editor [ERROR] editor error: no such command: '!q'
2023-01-09T15:41:28.895 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-01-09T16:07:40.995 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-01-09T16:08:12.714 helix_view::editor [ERROR] editor error: no such command: '!git'
2023-01-09T16:08:34.544 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-01-09T16:32:11.168 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["[scratch]"]
2023-01-09T16:32:13.299 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["[scratch]"]

Platform

Linux

Terminal Emulator

alacritty 0.11.0-dev

Helix Version

helix 22.12 (96ff64a)

@lexeyOK lexeyOK added the C-bug Category: This is a bug label Jan 9, 2023
@the-mikedavis
Copy link
Member

Also see #2019

@kirawi kirawi added the A-core Area: Helix core improvements label Jan 9, 2023
@the-mikedavis
Copy link
Member

This was fixed by #4123

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

No branches or pull requests

3 participants