- DocC documentation for all three library products: TextBuffer, TextRope, and TextBufferTesting each have a DocC catalog with a landing page and organized topic groups.
- "Choosing a Buffer" article — decision guide with comparison table and code examples, positioning
SendableRopeBufferas the recommended in-memory buffer. - "Undo and Redo" article — explains both
UndoManager-based andOperationLog-based strategies with code examples. - Doc comments for previously undocumented public types:
TextBufferprotocol,RopeBuffer,SendableRopeBuffer,TransferableUndoable,PuppetUndoManager,OperationLog,UndoGroup,BufferOperation,BufferContent,TextRope, and all TextBufferTesting helpers.
- BREAKING:
InMemoryBuffertypealias now points toSendableRopeBuffer(wasMutableStringBuffer). The rope-backed,Sendablevalue type with built-in undo is the proper in-memory buffer for production use.MutableStringBufferremains available by its concrete name. EditingBuffertypealias added forTransferableUndoable<RopeBuffer>— the@MainActorbuffer for UI-connected editing with system undo integration.- ADR-011: Multi-buffer in-memory architecture.
TextBufferprotocol — base protocol withoutAnyObject, enabling struct conformers.Bufferrefines it, so existing class conformers are unaffected.SendableRopeBuffer—Sendablevalue-type buffer combiningTextRope+OperationLog+ selection. Conforms toTextBuffer,TextAnalysisCapable, andCustomStringConvertible. Designed for concurrent batch processing viaTaskGroup.SendableRopeBuffer.comparator(_:_:...)— factory returning@Sendablecomparison closures. Callers choose components to compare (.content,.selection,.undoHistory).OperationLog.popUndo()/popRedo()— cursor manipulation methods for struct-based undo replay without exclusivity violations.SendableRopeBufferconversion surface:init(copying:),init(from:),toRopeBuffer(),toTransferableUndoable().TransferableUndoable.sendableSnapshot()/represent(_: SendableRopeBuffer)for round-trip snapshot transfer with undo history.makeSendableRopeBuffer(_:)factory inTextBufferTesting.applyStep(_:to: inout SendableRopeBuffer)andassertSendableUndoEquivalence(initial:steps:)for step-driven undo equivalence testing.- ADR-010: Sendable value-type buffer via protocol split.
TextAnalysisCapablenow refinesTextBufferinstead ofBuffer, enabling struct conformers to providewordRange/lineRange.assertBufferState,MutableStringBuffer.init(copying:),RopeBuffer.init(copying:)acceptTextBuffer(widened fromBuffer).change(buffer:to:)gains aninoutoverload forTextBuffervalue types.
change(buffer:to:)non-inoutoverload — usechange(buffer: &buffer, to:)instead.
Undoable: replacedisolated deinitwith nonisolated deinit usingMainActor.assumeIsolated. The Swift 6.2 runtime aborts (signal 6) when a@MainActorclass withisolated deinitis deallocated without a running RunLoop (XCTest CLI, background threads).- TextRope: CRLF split invariant in delete's leaf merge.
- TextRope: precondition guards on public API for bounds checking.
- TextRope: tree invariant validation for oversized leaf siblings.
TextRope— B-tree rope data structure with O(log n) insert, delete, and replace. UTF-8 storage with cached UTF-16 counts. Value semantics with copy-on-write.RopeBuffer—BufferandTextAnalysisCapableconformance wrappingTextRope, with selection tracking. Drop-in alternative toMutableStringBufferfor large documents.- New
TextRopelibrary target (zero dependencies), re-exported byTextBuffer.
TransferableUndoablebuffer wrapper withOperationLog-backed undo/redo.snapshot()andrepresent(_:)for transferring buffer state (content + undo history) between buffers.PuppetUndoManagerfor bridgingTransferableUndoableinto AppKit'sUndoManagersystem.BufferOperation,UndoGroup, andOperationLogvalue types for inspectable undo history.undoGrouping(actionName:_:)for grouping multiple mutations into a single undo step.
- Renamed
MutableStringBuffer.init(wrapping:)toinit(copying:). UndoGroupproperties are nowinternal(set).- Replaced
assertwithpreconditionfor overflow check inresized(by:). - Replaced
try!and force unwraps withpreconditionFailurediagnostics. - Requires macOS 13+ (added platform requirement to Package.swift).
Initial public release.