From a2bbe913cf441915f873f941b862f493ea5fdef5 Mon Sep 17 00:00:00 2001 From: Anton Duda Date: Sun, 26 Oct 2025 22:16:20 +0300 Subject: [PATCH] fix: Fix extension behavior on new document creation --- src/editor/StrudelPlugin.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/editor/StrudelPlugin.ts b/src/editor/StrudelPlugin.ts index 294a1a7..4ade463 100644 --- a/src/editor/StrudelPlugin.ts +++ b/src/editor/StrudelPlugin.ts @@ -14,6 +14,8 @@ const findBlocks = ( ): StrudelBlockInfo[] => { const blocks: StrudelBlockInfo[] = [] + if (state.doc.length === 0) return blocks + if (from === to) return blocks const startLine = state.doc.lineAt(from)