Skip to content

Panic assertion failed: pos > start in markdown component #13569

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

Open
altwazar opened this issue May 19, 2025 · 1 comment · May be fixed by helix-editor/tree-house#15
Open

Panic assertion failed: pos > start in markdown component #13569

altwazar opened this issue May 19, 2025 · 1 comment · May be fixed by helix-editor/tree-house#15
Labels
C-bug Category: This is a bug
Milestone

Comments

@altwazar
Copy link

Summary

Crash on auto-completion use std::pin or "show docs for item under cursor" on pin in this line.

Reproduction Steps

I tried this:

  1. cargo new hxtest && cd hxtest && hx src/main.rs

  2. Type use std::pin then tab

Get crash:

thread 'main' panicked at helix-term/src/ui/markdown.rs:93:9:
assertion failed: pos > start
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: helix_term::ui::markdown::highlighted_code_block
   4: helix_term::ui::markdown::Markdown::parse
   5: <helix_term::ui::markdown::Markdown as helix_term::compositor::Component>::render
   6: <helix_term::ui::completion::Completion as helix_term::compositor::Component>::render
   7: <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::render
   8: helix_term::application::Application::render::{{closure}}
   9: hx::main_impl::{{closure}}
  10: tokio::runtime::park::CachedParkThread::block_on
  11: tokio::runtime::context::runtime::enter_runtime
  12: tokio::runtime::runtime::Runtime::block_on
  13: hx::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Helix log

~/.cache/helix/helix.log [helix.log](https://github.com/user-attachments/files/20277942/helix.log)

Platform

Linux

Terminal Emulator

wezterm 20240203-110809-5046fc22-gentoo

Installation Method

source

Helix Version

helix 25.01.1 (f157a91)

@altwazar altwazar added the C-bug Category: This is a bug label May 19, 2025
@CalebLarsen
Copy link
Contributor

I was able to reproduce and found another way to trigger that I think is worth noting.

/// ```
/// /// `Something`
/// /// Anything
/// ```
struct Broken {}

This crashes when hovering Broken. Something about the highlighting for Something makes the syntax_highlighter get hung up and not advance the position to highlight.

@the-mikedavis the-mikedavis marked this as a duplicate of #13570 May 19, 2025
@the-mikedavis the-mikedavis changed the title Panic/crash on f157a918 Panic assertion failed: pos > start in markdown component May 19, 2025
@the-mikedavis the-mikedavis added this to the 25.06 milestone May 21, 2025
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

Successfully merging a pull request may close this issue.

3 participants