read method
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);
}
}