From 19597e3f1da418cedae39148e2fc953ad0a803d5 Mon Sep 17 00:00:00 2001 From: MoonGyu1 Date: Sun, 17 Sep 2023 20:39:37 +0900 Subject: [PATCH] Add last node to toBeStyleds if boundary type is End --- src/document/crdt/text.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/document/crdt/text.ts b/src/document/crdt/text.ts index 4002214c9..f9eca1b03 100644 --- a/src/document/crdt/text.ts +++ b/src/document/crdt/text.ts @@ -351,7 +351,12 @@ export class CRDTText extends CRDTGCElement { toBeStyleds.push(toNode!); toNode!.setStyleOpsAfter(toOpSet!); } else if (toBoundaryType === BoundaryType.End) { - // TODO(MoonGyu1): Add last node to toBeStyled + // Add last node to toBeStyled if boundary type is End + let lastNode = fromNode; + while (lastNode.getNext() && !lastNode.getNext()!.isRemoved()) { + lastNode = lastNode.getNext()!; + } + toBeStyleds.push(lastNode); if (!toOpSet) this.lastAnchor = new Set(); } }