read method

  1. @override
String read(
  1. int from,
  2. int to
)

Read the part of the document between the given positions.

Implementation

@override
String read(int from, int to) {
  final stringStart = _cursorPos - _string.length;
  if (from < stringStart || to >= _cursorPos) {
    return doc.sliceString(from, to);
  } else {
    return _string.substring(from - stringStart, to - stringStart);
  }
}