insertDelta method
Pastes the insert-only fragment (may be multi-op and contain
newlines and embeds) over the current selection as a single isolated
history group, then puts the caret after the pasted content.
A single trailing unattributed newline on the fragment is dropped (Quill paste semantics: the current line's own newline terminates the last pasted paragraph, so pasting a one-paragraph fragment mid-line does not split the line); an attributed trailing newline, or one following an embed, is kept. A fragment that is empty after that is a no-op that does not notify; otherwise notifies exactly once.
Implementation
void insertDelta(Delta fragment) {
final caret = _composeFragment(fragment);
if (caret == null) {
return;
}
_selection = _clampSelection(TextSelection.collapsed(offset: caret));
notifyListeners();
}