end method
void
end()
End the compound operation, combining all recorded edits into one.
Implementation
void end() {
if (!_isActive) return;
_isActive = false;
final newOps = _controller.undoStack.sublist(_startStackSize);
if (newOps.isEmpty) return;
_controller.undoStack.removeRange(
_startStackSize,
_controller.undoStack.length,
);
final compound = CompoundOperation(
operations: newOps,
selectionBefore: newOps.first.selectionBefore,
selectionAfter: newOps.last.selectionAfter,
multiCursorsBefore: newOps.first.multiCursorsBefore,
multiCursorsAfter: newOps.last.multiCursorsAfter,
);
_controller.undoStack.add(compound);
_controller._notifyListenersPublic();
}