cursor.ch is 0-based, so it should be ``if (cursor.ch < (line.length - 1))``. Otherwise, we're returning an invalid cursor when the current cursor is at the very end of the line.