Skip to content

narrowTo

Selects the next most narrow selection that contains all of a given unit type.

For example with text "fooBar" and a selection of "fooBa", narrowTo would shrink the selection to "foo" when the unit was "subword". This is because the two subwords in this selection are "foo" and "Bar".

Arguments

  • unit: the name of the unit type to narrow to; see Motion Units
  • boundary: the boundaries to narrow to; either start, end, or both.