indentLines method

bool indentLines({
  1. int width = 2,
})

Indents the selected lines, or the current line if there is no selection.

Implementation

bool indentLines({int width = 2}) {
  return _runEditFrame(() {
    _beginHistoryAction(_TextAreaHistoryAction.transform, breakChain: true);
    final result = textIndentLinesDocument(
      document: _document,
      state: _currentLineStateSnapshot(),
      width: width,
    );
    if (!result.changed) {
      return false;
    }

    _recordUndoSnapshot();
    _applyOffsetCommandResult(result);
    return true;
  });
}