Format code

pull/13/head
singerdmx 4 years ago
parent e475d3b0c9
commit f3e1be82e5
  1. 3
      lib/models/documents/history.dart
  2. 3
      lib/widgets/controller.dart

@ -95,8 +95,7 @@ class History {
for (var i = 0; i < ops.length; i++) { for (var i = 0; i < ops.length; i++) {
if (ops[i].key == Operation.insertKey) { if (ops[i].key == Operation.insertKey) {
len = ops[i].length; len = ops[i].length;
} } else if (ops[i].key == Operation.deleteKey) {
else if (ops[i].key == Operation.deleteKey){
len = ops[i].length * -1; len = ops[i].length * -1;
} }
} }

@ -56,7 +56,8 @@ class QuillController extends ChangeNotifier {
// updateSelection( // updateSelection(
// TextSelection.collapsed(offset: document.length), ChangeSource.LOCAL); // TextSelection.collapsed(offset: document.length), ChangeSource.LOCAL);
updateSelection( updateSelection(
TextSelection.collapsed(offset: this.selection.baseOffset + len), ChangeSource.LOCAL); TextSelection.collapsed(offset: this.selection.baseOffset + len),
ChangeSource.LOCAL);
} else { } else {
// no need to move cursor // no need to move cursor
notifyListeners(); notifyListeners();

Loading…
Cancel
Save