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.
This commit is contained in:
2026-02-16 22:58:11 +08:00
parent 0d25f4d1ef
commit d9418fac98
+1 -4
View File
@@ -149,10 +149,7 @@ function addGhostMarksToTextNodes(tr: any, from: number, to: number, markType: a
const end = Math.min(pos + node.nodeSize, to) const end = Math.min(pos + node.nodeSize, to)
if (end <= start) return true if (end <= start) return true
const $pos = tr.doc.resolve(start) tr.addMark(start, end, markType.create())
if ($pos.parent.type.allowsMarkType?.(markType)) {
tr.addMark(start, end, markType.create())
}
return true return true
}) })
} }