It's been irritating me that after saving an edit buffer, the undo history disappears; the attached patch restores the undo history.