indentMore function

bool indentMore(
  1. StateCommandTarget target
)

Add a unit of indentation to all selected lines.

Implementation

bool indentMore(StateCommandTarget target) {
  if (target.state.isReadOnly) return false;

  final state = target.state;
  final unit = state.facet(indentUnit);

  target.dispatch(state.update([
    TransactionSpec(
      changes: _changeBySelectedLine(state, (line, changes, range) {
        changes.add(ChangeSpec(from: line.from, insert: unit));
      }).changes,
      userEvent: 'input.indent',
    ),
  ]));
  return true;
}