setSelection method

void setSelection(
  1. CellAnchor base,
  2. CellAnchor extent, {
  3. SelectionMode? mode,
})

Set selection on the terminal from base to extent. This method takes the ownership of base and extent and will dispose them when the selection is cleared or changed.

Implementation

void setSelection(CellAnchor base, CellAnchor extent, {SelectionMode? mode}) {
  _selectionBase?.dispose();
  _selectionBase = base;

  _selectionExtent?.dispose();
  _selectionExtent = extent;

  if (mode != null) {
    _selectionMode = mode;
  }

  notifyListeners();
}