Fix bug #16961 with visual-order cursor movement and word-wrap.