saveState method

void saveState({
  1. String description = 'Document change',
  2. bool forceNewAction = false,
})

Begins capturing the old document state for a delta-based undo. The delta is committed automatically by updateContent after the mutation, producing a minimal undo record that stores only the changed top-level nodes (50-100x smaller than a full snapshot).

Implementation

void saveState({
  String description = 'Document change',
  bool forceNewAction = false,
}) {
  registry.dispatchSaveState(this, description);
  _undoRedoManager.beginSaveState(
    this,
    description: description,
    forceNewAction: forceNewAction,
  );
}