Skip to content

Jump to a markdown heading in the preview #316

Description

@jongio

Add a heading jump for markdown files in the Preview panel. Long README and docs files are hard to move through with line scrolling alone. A heading list lets you jump straight to a section.

Solution

Parse ATX headings (# through ######) from the previewed markdown, show them in a jump overlay indented by level, and scroll the preview to the chosen heading's line on select. Only offer the key when the current file is markdown.

Acceptance criteria

  • A Preview key opens a heading list for markdown files and scrolls to the selected heading.
  • Headings show their nesting level and preserve document order.
  • Fenced code blocks that contain # lines are not treated as headings.
  • The key is listed in internal/keybindings/keybindings.json and the help overlay.
  • Unit tests cover heading extraction, including the code-fence exclusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestideaFeature idea from the idea pipeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions