setSelection method

void setSelection(
  1. TextSelection t
)

Implementation

void setSelection(TextSelection t) {
  if (selection == t) {
    return;
  }
  selection = t;
  markNeedsPaint();

  if (!_shiftPressed && !_isDragging) {
    // Only update extend selection origin if Shift key is not pressed and
    // user is not dragging selection.
    _extendSelectionOrigin = selection;
  }
}