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