To reproduce (macOS 11.6 (20G165)):
- Run attached project
- Create a new document
- Place insertion point at the end of the document
- Add two characters
- Undo 2x
- Observe:
*** -[NSBigMutableString substringWithRange:]: Range {14, 1} out of bounds; string length 14
- Redo.
- Observe:
__redoCommonDoSingle:: NSUndoManager 0x600003d12580 is in invalid state, do not invoke this method while undoing
UndoTest.zip