deleteBackward method
backward delete one character
Implementation
Future<bool> deleteBackward() async {
final selection = this.selection;
if (selection == null || !selection.isCollapsed) {
return false;
}
final node = getNodeAtPath(selection.start.path);
final delta = node?.delta;
if (node == null || delta == null) {
return false;
}
final transaction = this.transaction;
final index = delta.prevRunePosition(selection.startIndex);
transaction.deleteText(node, index, selection.startIndex - index);
await apply(transaction);
return true;
}