Editing at Scale
Every edit in Caxton is a piece-table splice — a 10 GB document takes keystrokes with about a millisecond of apply latency, and bulk operations are engineered as single passes.
Multi-cursor editing
⌥Click adds a cursor (click one again to remove it). ⌃⌘G places a cursor on every occurrence of the selection. Typing, deleting, and pasting apply at every cursor simultaneously and land as one undo step.
Eight carets, one keystroke each. The cap is 1,000 cursors — a keystroke at the full cap on a 10 GB file applies in under 120 ms.
Rectangular selection
⌥Drag selects a column of text across rows. The result is an ordinary multi-cursor selection, so typing or deleting edits every row at once.
Option-drag for column selection — each row gets its own selection span, clamped to shorter lines.
Undo, redo, and bulk operations
- Undo history is unlimited in count and capped by memory; batch operations (Replace All, multi-cursor edits) are single entries.
- Undoing a 1.6-million-site Replace All takes milliseconds — the batch replays through the same bulk engine that applied it.
- Replace batches beyond roughly a million sites can exceed the undo memory cap; Caxton applies them but reports that the step can't be undone, instead of silently dropping history.
Saving
Saves are atomic by default — the file is rewritten alongside and swapped in, so a crash mid-save can never leave a truncated original. Editing near the front of a 10 GB file and saving costs an ~11 s full rewrite (measured, ~880 MB/s); in-place saves handle append-only cases much faster, protected by a patch journal (see Sessions & Recovery).