-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Auto-pairs with AltGr key cause crash #3946
Comments
I can reproduce with the following config (any three-byte char instead of → should work): [editor.auto-pairs]
'→' = 'a' Typing the following causes Helix to crash: $ RUST_BACKTRACE=1 hx
i→→
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Char index out of bounds: char index 6, Rope/RopeSlice char length 5', /home/me/.local/share/cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ropey-1.5.0/src/slice.rs:349:41
stack backtrace:
0: rust_begin_unwind
at /rustc/1.63.0/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/1.63.0/library/core/src/panicking.rs:142:14
2: core::result::unwrap_failed
at /rustc/1.63.0/library/core/src/result.rs:1805:5
3: ropey::slice::RopeSlice::char_to_byte
4: helix_core::graphemes::nth_next_grapheme_boundary
5: helix_core::selection::Selection::ensure_invariants
6: helix_view::document::Document::apply_impl
7: helix_view::document::Document::apply
8: helix_term::commands::insert::insert_char
9: helix_term::ui::editor::EditorView::insert_mode
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: helix_term::application::Application::event_loop_until_idle::{{closure}}
14: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
15: std::thread::local::LocalKey<T>::with
16: tokio::park::thread::CachedParkThread::block_on
17: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
18: tokio::runtime::Runtime::block_on
19: hx::main The first |
Thanks for the report, I was able to reproduce. I'll look into this when I get a chance. |
I've identified the issue, should have a PR up either tonight or tomorrow. |
Any update? |
Yes, sorry, it's pretty close now. I took this opportunity to migrate the auto pairs tests to the integration framework, but I encountered a couple of bugs in the helper functions that delayed it a bit. But I should have a PR ready in a day or two. |
PR submitted: #4024 |
Summary
Hi all,
on German keyboards ‘typographic’ quotation marks require the use of the
AltGr
key.Using automatic paring in combination with the
AltGr
causes a helix crash.Thank you very much!
Reproduction Steps
I tried this:
hx
AltGr + v
Expected behaviour:
AltGr + v
should produce a„
; helix’s auto-pairing should extend this to„“
.Helix log
~/.cache/helix/helix.log
Error message:
Platform
Void with River WM
Terminal Emulator
Fish
Helix Version
22.08.1
The text was updated successfully, but these errors were encountered: