textIndentLinesDocument function

TextCommandResult textIndentLinesDocument({
  1. required TextDocument document,
  2. required TextLineStateSnapshot state,
  3. int width = 2,
})

Implementation

TextCommandResult textIndentLinesDocument({
  required TextDocument document,
  required TextLineStateSnapshot state,
  int width = 2,
}) {
  final clampedState = _clampLineStateSnapshotToDocument(state, document);
  final span = _selectedLineSpan(clampedState);
  return _documentResultFromWindowedLineCommand(
    document: document,
    state: clampedState,
    startLine: span.startLine,
    endLine: span.endLine + 1,
    apply: (lines, localState) =>
        textIndentLines(lines: lines, state: localState, width: width),
  );
}