fix undo selection range after delete