selectedLineRange method

({int endLine, int startLine}) selectedLineRange()

Implementation

({int startLine, int endLine}) selectedLineRange() {
  final currentSelection = _selection;
  if (currentSelection == null || currentSelection.isCollapsed) {
    return (startLine: _cursor.line, endLine: _cursor.line);
  }

  return (
    startLine: math.min(
      currentSelection.start.line,
      currentSelection.end.line,
    ),
    endLine: math.max(currentSelection.start.line, currentSelection.end.line),
  );
}