getLineThis method

int getLineThis(
  1. int index
)

Returns the start index of the line which contains the given index.

Implementation

int getLineThis(int index) {
  while (index > 0) {
    var c = _buffer.codeUnitAt(index - 1);
    if (c == 0xD || c == 0xA) {
      break;
    }
    index--;
  }
  return index;
}