restore selection and position after format