Skip to content

feat: add markdown heading fold/unfold in editor#4

Open
hoiyada7-maker wants to merge 1 commit into
mainfrom
feature/heading-fold
Open

feat: add markdown heading fold/unfold in editor#4
hoiyada7-maker wants to merge 1 commit into
mainfrom
feature/heading-fold

Conversation

@hoiyada7-maker

Copy link
Copy Markdown
Owner

Summary

  • Adds section folding for ATX headings (# ## ### etc.) in the CodeMirror editor
  • Custom foldService folds all content under a heading until the next equal-or-higher-level heading
  • Gutter fold markers (▾/▸) appear on heading lines — click to fold/unfold
  • Fold placeholder styled with accent color for visual clarity

Details

  • foldGutter() + custom markdownHeadingFold service added to editor extensions
  • foldKeymap registered: Ctrl+Shift+[ to fold, Ctrl+Shift+] to unfold
  • Gutter markers shown at 50% opacity, full opacity on hover — unobtrusive but discoverable

Test plan

  • Open a markdown file with multiple heading levels (#, ##, ###)
  • Verify fold gutter markers appear on heading lines
  • Click a marker to fold the section — content collapses to a placeholder
  • Click the placeholder or marker again to unfold
  • Test Ctrl+Shift+[ / Ctrl+Shift+] keyboard shortcuts

🤖 Generated with Claude Code

Adds section folding for ATX headings (# ## ###) via a custom
foldService that folds all content until the next equal-or-higher
heading. Gutter markers are clickable; Ctrl+Shift+[ / ] for keyboard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant