From 5850ffcad7bc7f854bf026d12aa93a15d4736f44 Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 8 Jun 2026 19:27:06 +0000 Subject: [PATCH] chore: fix CodeMirror view accessor in diagnostic script --- diagnostic-typst.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diagnostic-typst.js b/diagnostic-typst.js index 73f5a83af6..02409b55bb 100644 --- a/diagnostic-typst.js +++ b/diagnostic-typst.js @@ -4,10 +4,10 @@ * while a Typst file is open in the editor. */ -// 1. Find the active CodeMirror editor view +// 1. Find the active CodeMirror editor view (try several accessor patterns) const view = [...document.querySelectorAll('.cm-editor')] - .map(el => el.cmView?.view) - .find(Boolean) + .map(el => el.cmView?.view ?? el.cmView ?? el['__cm']) + .find(v => v?.state?.doc) if (!view) { console.error('No CodeMirror view found — make sure a file is open in the editor')