Restrict horizontal range of cursor to avoid unintentionally wrapping.
When converting a x position to cursor column for a wrapped text line, the last column should not be used or else the cursor will jump to the next line.
When converting a x position to cursor column for a wrapped text line, the last column should not be used or else the cursor will jump to the next line.