-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
C-bugCategory: This is a bugCategory: This is a bug
Milestone
Description
Summary
Helix panic after using dead keys in a somewhat complex markdown file.
thread 'main' panicked at /build/cargo-vendor-dir/tree-house-0.1.0/src/injections_query.rs:678:49:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: 0x55f266994c69 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h7964c48fa1e13ebd
1: 0x55f265a76303 - core::fmt::write::h26d370e762806908
2: 0x55f2669b777f - std::io::Write::write_fmt::h7172e38dd4e6c5be
3: 0x55f266994ac3 - std::sys::backtrace::BacktraceLock::print::hf0868af390127a97
4: 0x55f26698d4bc - std::panicking::default_hook::{{closure}}::hde4b94f2c8a1b75a
5: 0x55f26698d2d1 - std::panicking::default_hook::hb1abdd4b376f163b
6: 0x55f26698d9dd - std::panicking::rust_panic_with_hook::hd9708ed3eabf91e2
7: 0x55f266995516 - std::panicking::begin_panic_handler::{{closure}}::h5445e74fe4b5ee5a
8: 0x55f266994e79 - std::sys::backtrace::__rust_end_short_backtrace::h66f5b0e9fcf722b5
9: 0x55f26698d55c - rust_begin_unwind
10: 0x55f2659790c0 - core::panicking::panic_fmt::he6504b56be805f60
11: 0x55f26597914c - core::panicking::panic::h1a21611f9fc999c3
12: 0x55f265979039 - core::option::unwrap_failed::h0422a13e898d701f
13: 0x55f265d2dd02 - tree_house::injections_query::intersect_ranges::hbb39a596420f75a8
14: 0x55f265dc8275 - tree_house::parse::<impl tree_house::Syntax>::update::h3119d584bfc9e6a5
15: 0x55f265d2a1b4 - helix_core::syntax::Syntax::update::h2541291792a4accc
16: 0x55f26666517f - helix_view::document::Document::apply_impl::he79bb99f8d2ed2ef
17: 0x55f266665cc0 - helix_view::document::Document::apply_inner::he94396e41854acfa
18: 0x55f2664c2b36 - helix_term::commands::insert::insert_char::hedbe3a650536e2b7
19: 0x55f2660af8de - helix_term::ui::editor::EditorView::insert_mode::hb4bca75b4629f33f
20: 0x55f2660b1bb1 - <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event::h583a75b4509d9be1
21: 0x55f26604b36d - helix_term::compositor::Compositor::handle_event::h0bd73ca3643a2e68
22: 0x55f266728201 - hx::main_impl::{{closure}}::h4a5b0fbd2ba279f7
23: 0x55f2667262c8 - tokio::runtime::park::CachedParkThread::block_on::h64f97165232e40b4
24: 0x55f266764b72 - tokio::runtime::context::runtime::enter_runtime::hf4ee931d27bbf065
25: 0x55f266771cbd - tokio::runtime::runtime::Runtime::block_on::had2c18a25e0d54fc
26: 0x55f266783be2 - hx::main::h409e5129dd1dcd8a
27: 0x55f26679a323 - std::sys::backtrace::__rust_begin_short_backtrace::he1d7950b65b89009
28: 0x55f2667a706d - std::rt::lang_start::{{closure}}::h542f69aa70824c33
29: 0x55f26698ab35 - std::rt::lang_start_internal::h288bfc959f5ce5b2
30: 0x55f266783cd5 - main
31: 0x7fd25962a1fe - __libc_start_call_main
32: 0x7fd25962a2b9 - __libc_start_main_alias_2
33: 0x55f2659ed855 - _start
34: 0x0 - <unknown>
Reproduction Steps
After upgrading to helix f157a918a334b6f84730ffa358d766562f81727b
from 47547e94ad89cda4dbab15b57abcf4981d101b85
, I got a crash when trying to write code-blocks in a markdown file.
Since I can't repro with any other file I'm having trouble asserting that's 100% true but I see history of changes to tree house and that's where the stack trace points to.
I have not been able to build a reproduction example, and unfortunately can't share the markdown file.
The file looks roughly like the following
---
some frontmatter
---
# title
block
\`\`\`ruby
...
\`\`\`
\`\`\`ruby
...
\`\`\`
<!-- HTML comment -->
\`\`\`ruby
...
\`\`\`
-- typing my new block here
<!-- HTML comment -->
<!-- HTML comment 2 -->
removing the HTML comments seem to make the crash go away
Helix log
~/.cache/helix/helix.log
2025-05-16T15:17:59.320 helix_term::application [DEBUG] received editor event: LanguageServerMessage((LanguageServerId(1v1), Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [Object {"code": String("1"), "message": String("Ambiguous link to document '../redacted.md'"), "range": Object {"end": Object {"character": Number(229), "line": Number(21)}, "start": Object {"character": Number(177), "line": Number(21)}}, "relatedInformation": Array [Object {"location": Object {"range": Object {"end": Object {"character": Number(12), "line": Number(15)}, "start": Object {"character": Number(0), "line": Number(15)}}, "uri": String("file:///redacted.md")}, "message": String("Duplicate definition of document '../redacted.md'")}, Object {"location": Object {"range": Object {"end": Object {"character": Number(16), "line": Number(22)}, "start": Object {"character": Number(0), "line": Number(22)}}, "uri": String("file:///redacted.md")}, "message": String("Duplicate definition of document '../redacted.md'")}, Object {"location": Object {"range": Object {"end": Object {"character": Number(10), "line": Number(11)}, "start": Object {"character": Number(0), "line": Number(11)}}, "uri": String("file:///redacted.md")}, "message": String("Duplicate definition of document '../redacted.md'")}], "severity": Number(2), "source": String("Marksman")}], "uri": String("redacted.md)}) })))
2025-05-16T15:17:59.328 helix_term::application [DEBUG] received editor event: Redraw
2025-05-16T15:17:59.329 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2025-05-16T15:17:59.427 helix_term::application [DEBUG] received editor event: IdleTimer
2025-05-16T15:17:59.429 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2025-05-16T15:17:59.429 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2025-05-16T15:17:59.514 helix_core::auto_pairs [DEBUG] auto pair transaction: Transaction {
changes: ChangeSet {
changes: [
Retain(
4572,
),
],
len: 4572,
len_after: 4572,
},
selection: Some(
Selection {
ranges: [
Range {
anchor: 4502,
head: 4503,
old_visual_position: None,
},
],
primary_index: 0,
},
),
}
2025-05-16T15:17:59.514 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2025-05-16T15:17:59.636 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2025-05-16T15:17:59.765 helix_term::application [DEBUG] received editor event: IdleTimer
2025-05-16T15:18:00.246 helix_core::auto_pairs [DEBUG] auto pair transaction: Transaction {
changes: ChangeSet {
changes: [
Retain(
4502,
),
Insert(
"``",
),
Retain(
70,
),
],
len: 4572,
len_after: 4574,
},
selection: Some(
Selection {
ranges: [
Range {
anchor: 4503,
head: 4504,
old_visual_position: None,
},
],
primary_index: 0,
},
),
}
2025-05-16T15:18:00.257 helix_lsp::transport [ERROR] typos err: <- StreamClosed
2025-05-16T15:18:00.257 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server
Caused by:
channel closed
Stack backtrace:
0: helix_lsp::transport::Transport::process_server_message::{{closure}}
1: helix_lsp::transport::Transport::recv::{{closure}}
2: tokio::runtime::task::core::Core<T,S>::poll
3: tokio::runtime::task::harness::Harness<T,S>::poll
4: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
5: tokio::runtime::scheduler::multi_thread::worker::Context::run
6: tokio::runtime::context::runtime::enter_runtime
7: tokio::runtime::scheduler::multi_thread::worker::run
8: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
9: tokio::runtime::task::core::Core<T,S>::poll
10: tokio::runtime::task::harness::Harness<T,S>::poll
11: tokio::runtime::blocking::pool::Inner::run
12: std::sys::backtrace::__rust_begin_short_backtrace
13: core::ops::function::FnOnce::call_once{{vtable.shim}}
14: std::sys::pal::unix::thread::Thread::new::thread_start
15: start_thread
16: __GI___clone3)
Platform
Linux
Terminal Emulator
Ghostty 1.1.3
Installation Method
flake
Helix Version
helix 25.01.1 (f157a91)
CptPotato
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bugCategory: This is a bug