textOffsetForUtf8Point function

int textOffsetForUtf8Point(
  1. TextDocument document,
  2. TextUtf8Point point
)

Converts a UTF-8 parser point into a grapheme offset.

Implementation

int textOffsetForUtf8Point(TextDocument document, TextUtf8Point point) =>
    TextUtf8CoordinateIndex(document).offsetForPoint(point);