revert method
Revert this delta (undo). Replaces affected nodes with their pre-mutation state and restores the pre-mutation cursor.
Implementation
@override
void revert(FluentDocument document) {
if (index < 0 || index >= document.content.nodes.length) {
print('[UNDO_WARN] NodeInsertDelta.revert index $index out of bounds');
return;
}
document.content.nodes.removeAt(index);
document.invalidateNodeIndex();
oldCursor.restore(document);
}