From c725a17933304f30c66fe3be53db4401bc77a79b Mon Sep 17 00:00:00 2001 From: Xin Yao Date: Wed, 10 Mar 2021 22:48:03 -0800 Subject: [PATCH] Fix --- lib/widgets/controller.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/widgets/controller.dart b/lib/widgets/controller.dart index 534184c9..9c23d327 100644 --- a/lib/widgets/controller.dart +++ b/lib/widgets/controller.dart @@ -91,7 +91,10 @@ class QuillController extends ChangeNotifier { delta.isNotEmpty && delta.length <= 2 && delta.last.isInsert; - if (shouldRetainDelta && toggledStyle.isNotEmpty) { + if (shouldRetainDelta && + toggledStyle.isNotEmpty && + delta.length == 2 && + delta.last.data == '\n') { // if all attributes are inline, shouldRetainDelta should be false final anyAttributeNotInline = toggledStyle.values.any((attr) => !attr.isInline);