From 0efe0eabb4dcd1e8399bc5e52eb9084015a6fd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20Ho=C3=A0ng=20Sang?= Date: Fri, 25 Aug 2023 14:33:43 +0700 Subject: [PATCH] Update logic --- lib/src/widgets/controller.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/src/widgets/controller.dart b/lib/src/widgets/controller.dart index 2826e3f6..0780b9ea 100644 --- a/lib/src/widgets/controller.dart +++ b/lib/src/widgets/controller.dart @@ -122,14 +122,13 @@ class QuillController extends ChangeNotifier { formatSelection(Attribute.clone(Attribute.indentL1, null)); return; } - if (isIncrease && indent.value < 5) { - formatSelection(Attribute.getIndentLevel(indent.value + 1)); - return; - } - if (indent.value > 0) { - formatSelection(Attribute.getIndentLevel(indent.value - 1)); + if (isIncrease) { + if (indent.value < 5) { + formatSelection(Attribute.getIndentLevel(indent.value + 1)); + } return; } + formatSelection(Attribute.getIndentLevel(indent.value - 1)); } void _indentSelectionEachLine(bool isIncrease) {