Skip to content

0.2.0 — Outline of the Markdown source

Choose a tag to compare

@feibuilds feibuilds released this 29 Aug 08:47
· 53 commits to main since this release

An outline of the Markdown source, beside the file you are editing. The preview and its table of contents are unchanged.

Added

Ctrl+Shift+B / Cmd+Shift+B — MarkdownGlance: Toggle Outline. It lists the headings as they are written in the buffer — # markers, raw text, indented by level — in a group of its own beside the file, never as a tab in the preview's group.

  • The entry holding the caret is highlighted, with the headings above it marked, and both follow the caret as you move it.
  • The list re-scans as you type, after update_delay_ms.
  • Clicking an entry moves the caret to that heading and centres it, leaving focus in the outline so you can keep clicking.
  • The key toggles the way Zed's outline panel does: open and focus, focus if it is already open, close on a press from inside it.
  • One outline per file. It is revealed when its source is activated, renamed with it, and closed with it.

This reads the buffer, not the rendered document, so it needs no preview and no successful render — which is what separates it from the table of contents inside the preview. That TOC still comes out of the parsed document, still appears on its own once toc_minimum_length and toc_minimum_headings are met, and still scrolls the preview. Both can be open at once.

The scan handles ATX (#…######, closing hashes stripped) and setext (===, ---) headings, and skips fenced code blocks and YAML front matter, so a # comment inside a fence and the closing --- of front matter are not mistaken for headings.

One more Sublime Text default changes, in Markdown only

Ctrl+Shift+B is Build With… (build with select: true, measured in build 4200). This binding applies only while a Markdown source view or an outline this package created is focused; plain Ctrl+B is untouched everywhere, and Markdown has no build system. It is the key Zed gives its outline panel, which is the point of matching it.

To keep the key, delete that one entry from Preferences → Package Settings → MarkdownGlance → Key Bindings; MarkdownGlance: Toggle Outline stays in the command palette without it.

ADR 0010 records the decision, the measured defaults and why the outline is a separate surface rather than a mode of the preview's TOC. The feature note has a screenshot and the file map.

Full changelog: 0.1.4...0.2.0