apply method

  1. @override
void apply(
  1. FluentDocument document
)
override

Apply this delta (redo). Replaces affected nodes with their post-mutation state and restores the post-mutation cursor.

Implementation

@override
void apply(FluentDocument document) {
  if (index < 0 || index > document.content.nodes.length) {
    print('[UNDO_WARN] NodeInsertDelta.apply index $index out of bounds');
    return;
  }
  document.content.nodes.insert(index, _deserializeNode(nodeJson));
  document.invalidateNodeIndex();
  newCursor.restore(document);
}