Skip to content

Commit 70909df

Browse files
committed
Add last node to toBeStyleds if boundary type is
1 parent 1d385a5 commit 70909df

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/document/crdt/text.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,12 @@ export class CRDTText<A extends Indexable = Indexable> extends CRDTGCElement {
351351
toBeStyleds.push(toNode!);
352352
toNode!.setStyleOpsAfter(toOpSet!);
353353
} else if (toBoundaryType === BoundaryType.End) {
354-
// TODO(MoonGyu1): Add last node to toBeStyled
354+
// Add last node to toBeStyled if boundary type is End
355+
let lastNode = fromNode;
356+
while (lastNode.getNext() && !lastNode.getNext()!.isRemoved()) {
357+
lastNode = lastNode.getNext()!;
358+
}
359+
toBeStyleds.push(lastNode);
355360
if (!toOpSet) this.lastAnchor = new Set();
356361
}
357362
}

0 commit comments

Comments
 (0)