Improve white space handling when determining next/prev visible position