applyDeleteRules method
Applies heuristic rules to specified delete operation based on current
state of Notus document
.
Implementation
Delta applyDeleteRules(NotusDocument document, int index, int length) {
final delta = document.toDelta();
for (var rule in deleteRules) {
final result = rule.apply(delta, index, length);
if (result != null) return result..trim();
}
throw StateError('Failed to apply delete heuristic rules: none applied.');
}