Fix cursor placement when scrolling in history.