fix undo insert image on empty asset

pull/298/head
li3317 4 years ago
parent 2aa577ca58
commit cdd88241a6
  1. 4
      lib/src/widgets/controller.dart

@ -79,13 +79,13 @@ class QuillController extends ChangeNotifier {
} }
void _handleHistoryChange(int? len) { void _handleHistoryChange(int? len) {
if (len != 0) { if (len! > 0) {
// if (this.selection.extentOffset >= document.length) { // if (this.selection.extentOffset >= document.length) {
// // cursor exceeds the length of document, position it in the end // // cursor exceeds the length of document, position it in the end
// updateSelection( // updateSelection(
// TextSelection.collapsed(offset: document.length), ChangeSource.LOCAL); // TextSelection.collapsed(offset: document.length), ChangeSource.LOCAL);
updateSelection( updateSelection(
TextSelection.collapsed(offset: selection.baseOffset + len!), TextSelection.collapsed(offset: selection.baseOffset + len),
ChangeSource.LOCAL); ChangeSource.LOCAL);
} else { } else {
// no need to move cursor // no need to move cursor

Loading…
Cancel
Save