From d9418fac9892b326692155fa4c53d790a4465a1a Mon Sep 17 00:00:00 2001 From: ydy0615 Date: Mon, 16 Feb 2026 22:58:11 +0800 Subject: [PATCH] refactor(copilot): simplify ghost mark addition by removing conditional check Remove the mark type allowance validation and apply ghost marks directly to text nodes within the specified range. --- src/plugins/copilotPlugin.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/copilotPlugin.ts b/src/plugins/copilotPlugin.ts index c374341..419ac49 100644 --- a/src/plugins/copilotPlugin.ts +++ b/src/plugins/copilotPlugin.ts @@ -149,10 +149,7 @@ function addGhostMarksToTextNodes(tr: any, from: number, to: number, markType: a const end = Math.min(pos + node.nodeSize, to) if (end <= start) return true - const $pos = tr.doc.resolve(start) - if ($pos.parent.type.allowsMarkType?.(markType)) { - tr.addMark(start, end, markType.create()) - } + tr.addMark(start, end, markType.create()) return true }) }