Fixes bug in UndoManager where entering text while redo stack is not empty causes error. The error is caught in record and therefore the undo and redo stacks are cleared. The error specifically occurs because the 'oldDelta' does not match the editor state, and more specifically when that means the oldDelta lengths are incorrect. This change causes the oldDelta to be updated whenever the UndoManager has an undo or redo triggered.