moveActiveCell method

UserSelectionState moveActiveCell(
  1. IntVector2 getNextCoordinate(
    1. IntVector2 coordinate
    )
)

Converts the primarySelection's originCell into a CellUserSelectionModel and moves it in a given AxisDirection.

The only constraints applied to the new coordinate are that the new coordinates must be positive.

See also:

  • TableShortcuts and TableActions where the shortcuts are mapped into actions that allow the user to expand the last selection

Implementation

UserSelectionState moveActiveCell(
  IntVector2 Function(IntVector2 coordinate) getNextCoordinate,
) {
  final newAnchor = getNextCoordinate(
    primarySelection.anchorCoordinate,
  );

  return resetSelectionsToACellSelection(
    anchor: newAnchor,
    focus: newAnchor,
  );
}