Fixed undo handling for delete when cursor is at beginning of file