Give Draftboard's editor an undo history that behaves the way writers expect: reversible commands, typing that undoes a word at a time, grouped edits and a bounded history.
Undo and redo
Edits as reversible commands on two stacks, with validation and a redo stack that clears on new edits.
Undo steps
Merge typing into word-sized steps, group multi-edit operations, and cap the history length.
Restore the cursor
After undo or redo, put the cursor where the change happened.
Build undo and redo the way editors do: edits as reversible commands, an undo and a redo stack, merging typing into words, grouping edits into one step, and a capped history.