lineLengthAt method

int lineLengthAt(
  1. int lineIndex
)

Length of the line in code units, excluding \n and a preceding \r.

Implementation

int lineLengthAt(int lineIndex) {
  final start = getLineStartOffset(lineIndex);
  final end = findLineEnd(start);
  final lineLength = end - start;
  return lineLength > 0 && codeUnitAt(end - 1) == 13
      ? lineLength - 1
      : lineLength;
}