getIndentUnit function

int getIndentUnit(
  1. EditorState state
)

Get the indent unit size (number of columns).

Implementation

int getIndentUnit(EditorState state) {
  final unit = state.facet(indentUnit);
  if (unit.isEmpty) return 2;
  return unit.codeUnitAt(0) == 9 ? state.tabSize : unit.length;
}