chore: format code

This commit is contained in:
Lucas.Xu 2022-08-09 19:37:46 +08:00
parent 3e256be0b9
commit 215587a507

View File

@ -106,18 +106,19 @@ class TransactionBuilder {
insertText(TextNode node, int index, String content,
[Attributes? attributes]) {
var newAttributes = attributes;
if (index != 0 && attributes == null) {
newAttributes = node.delta
.slice(max(index - 1, 0), index)
.operations
.first
.attributes;
}
textEdit(
node,
() => Delta().retain(index).insert(
content,
attributes ??
(index == 0
? null
: node.delta
.slice(max(index - 1, 0), index)
.operations
.first
.attributes),
newAttributes,
),
);
afterSelection = Selection.collapsed(