isIndentable function

bool isIndentable(
  1. EditorState editorState
)

Implementation

bool isIndentable(EditorState editorState) {
  final selection = editorState.selection;
  if (selection == null || !selection.isSingle) {
    return false;
  }
  final node = editorState.getNodeAtPath(selection.end.path);
  final previous = node?.previous;
  if (node == null ||
      previous == null ||
      !indentableBlockTypes.contains(previous.type) ||
      !indentableBlockTypes.contains(node.type)) {
    return false;
  }
  return true;
}