zed/crates/markdown_preview
Smit Barmase 1102219f81
markdown_preview: Open Markdown links in preview and scroll to linked headings and positions (#61784)
Closes #60985

Clicking a link to a Markdown file from a Markdown preview now opens the
target in a preview instead of the raw editor buffer. `alt`-click opens
the raw source editor instead.

- If there exists existing preview of that file it is reused. A link
back to the file being previewed navigates in place.
- `file.md#heading-slug` scrolls the preview to the linked heading.
- `file.md:42:5`, `file.md#L42` and `file.md#L42C5` open the preview
scrolled to that position with the cursor placed there. Non-Markdown
targets keep the existing behavior from #60864 (raw editor at the
position).

Added tests covering these and more cases.

Release Notes:

- Improved Markdown preview links: links to Markdown files now open in a
preview (scrolled to the linked heading or position) instead of the raw
file, and `alt`-click opens the raw source instead.
- Fixed GitHub-style `#L<line>C<column>` link fragments not placing the
cursor at the linked position.
2026-07-28 13:56:46 +00:00
..
src markdown_preview: Open Markdown links in preview and scroll to linked headings and positions (#61784) 2026-07-28 13:56:46 +00:00
Cargo.toml markdown_preview: Do not show deleted hunks (#59485) 2026-06-18 12:48:18 +00:00
LICENSE-GPL