fix bug with select-to-end + append mode