|
|
|
@ -32,7 +32,8 @@ class Document { |
|
|
|
|
|
|
|
|
|
Stream<Tuple3> get changes => _observer.stream; |
|
|
|
|
|
|
|
|
|
Document() : _delta = Delta()..insert('\n') { |
|
|
|
|
Document() : _delta = Delta() |
|
|
|
|
..insert('\n') { |
|
|
|
|
_loadDocument(_delta); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -138,7 +139,11 @@ class Document { |
|
|
|
|
offset += op.length; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
_delta = _delta.compose(delta); |
|
|
|
|
} catch (e) { |
|
|
|
|
throw ('_delta compose failed'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (_delta != _root.toDelta()) { |
|
|
|
|
throw ('Compose failed'); |
|
|
|
@ -179,7 +184,8 @@ class Document { |
|
|
|
|
_root.insert(offset, data, style); |
|
|
|
|
} else { |
|
|
|
|
throw ArgumentError.value(doc, |
|
|
|
|
'Document Delta can only contain insert operations but ${op.key} found.'); |
|
|
|
|
'Document Delta can only contain insert operations but ${op |
|
|
|
|
.key} found.'); |
|
|
|
|
} |
|
|
|
|
offset += op.length; |
|
|
|
|
} |
|
|
|
|