Skip to content

Commit

Permalink
Add last node to toBeStyleds if boundary type is End
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonGyu1 committed Sep 17, 2023
1 parent 1d385a5 commit 19597e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/document/crdt/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ export class CRDTText<A extends Indexable = Indexable> 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();
}
}
Expand Down

0 comments on commit 19597e3

Please sign in to comment.