fixed _getCursorIndexForRelativePosition