extendSelection method

void extendSelection(
  1. Position from, [
  2. Position? to,
  3. Map? options
])

Similar to setSelection, but will, if shift is held or the extending flag is set, move the head of the selection while leaving the anchor at its current place. to is optional, and can be passed to ensure a region (for example a word or paragraph) will end up selected (in addition to whatever lies between that region and the current anchor). When multiple selections are present, all but the primary selection will be dropped by this method. Supports the same options as setSelection.

Implementation

void extendSelection(Position from, [Position? to, Map? options]) {
  callArgs('extendSelection', [from.toProxy(), to?.toProxy(), options]);
}