Apple Text Undo Manager

0•

Implements and debugs complex undo and redo logic for Apple’s TextKit, UITextView, and NSTextView frameworks.

The txt-undo skill provides specialized guidance for managing the undo stack within Apple’s text-editing ecosystems, covering both TextKit 1 and TextKit 2. It helps developers navigate sophisticated NSUndoManager patterns, such as grouping multiple programmatic edits into single operations, ensuring UTF-16 length accuracy in custom storage subclasses, and preventing state corruption during Writing Tools sessions. Whether you are building a simple notepad or a complex IDE, this skill ensures that user actions like 'Undo' and 'Redo' remain reliable and crash-free even with highly customized text behavior.

주요 기능

01Programmatic edit management with registration toggling
02TextKit 2 transaction and content manager integration
030 GitHub stars
04NSUndoManager grouping and coalescing optimization
05Debugging for changeInLength and range-based corruption
06Writing Tools compatibility and session guarding

사용 사례

01Fixing NSRangeException crashes that occur specifically during Cmd+Z
02Implementing undoable programmatic inserts in database-backed text editors
03Grouping multi-step 'Replace All' operations into a single undo action