Skip to content

Conversation

@schemen
Copy link
Owner

@schemen schemen commented Jan 1, 2026

  • Widget reuse: Added MetadataWidget.eq() so CodeMirror reuses DOM when values/styles don’t change, avoiding re‑render per keystroke (editor-metadata.ts).
  • Selection behavior: Only reveal raw syntax when the cursor is inside a marker, not for selection ranges; reduces rebuilds during selection (editor-metadata.ts).
  • Fast‑path for plain values: Skip MarkdownRenderer when the value has no markdown hints; just set textContent (markdown-render.ts).
  • Range scanning skip: Avoid regex scanning a range if it doesn’t contain the opener ({{ / [%) (editor-metadata.ts).
  • Rebuild gating: On edits, map decorations and rebuild only if the change touches a marker or frontmatter, or if the cursor enters/leaves a marker (editor-metadata.ts).
  • Per‑line marker cache: Cache marker positions per line and only re‑scan changed lines instead of full visible ranges (editor-metadata.ts).
  • Frontmatter lookup caching: Added a lazy resolver with per‑key memoization and case‑insensitive key‑map caching; no cache is created unless a marker is actually resolved (metadata-utils.ts, editor-metadata.ts, metadata-renderer.ts).
  • Empty‑value click fix: Empty widgets now pass events through + have a tiny hit‑box, preventing cursor misplacement without extra rendering (editor-metadata.ts, styles.css).

@schemen schemen merged commit 7ecf8d4 into master Jan 1, 2026
4 checks passed
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.

2 participants