void OnEndUndo (object sender, TextDocument.UndoOperationEventArgs e) { if (e == null) return; e.Operation.Tag = new TextEditorDataState (this, savedCaretPos, savedSelection); }