textToggleChecklistStateDocument function
TextCommandResult
textToggleChecklistStateDocument({
- required TextDocument document,
- required TextLineStateSnapshot state,
- String checkedMarker = 'x',
Implementation
TextCommandResult textToggleChecklistStateDocument({
required TextDocument document,
required TextLineStateSnapshot state,
String checkedMarker = 'x',
}) {
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) => textToggleChecklistState(
lines: lines,
state: localState,
checkedMarker: checkedMarker,
),
);
}