fix inserting tab character in lists

pull/1171/head
Bohdan Uhrynovskyi 2 years ago
parent d62be3d12a
commit 85e216d428
  1. 12
      lib/src/widgets/raw_editor.dart

@ -665,18 +665,22 @@ class RawEditorState extends EditorState
return insertTabCharacter();
}
if (node.isNotEmpty && (node.first as leaf.Text).value.isNotEmpty) {
return insertTabCharacter();
}
final parentBlock = parent;
if (parentBlock.style.containsKey(Attribute.ol.key) ||
parentBlock.style.containsKey(Attribute.ul.key) ||
parentBlock.style.containsKey(Attribute.checked.key)) {
if (node.isNotEmpty && (node.first as leaf.Text).value.isNotEmpty
&& controller.selection.base.offset > node.documentOffset) {
return insertTabCharacter();
}
controller.indentSelection(!event.isShiftPressed);
return KeyEventResult.handled;
}
if (node.isNotEmpty && (node.first as leaf.Text).value.isNotEmpty) {
return insertTabCharacter();
}
return insertTabCharacter();
}

Loading…
Cancel
Save