Leave cursor in the right place when scrolling