expandRangeToSurroundingWord

Type: Function

Returns a copy of the given range. If the given range is collapsed and in the middle of a word, the copy will be expanded to surround the complete word. If the given range was not collapsed or bordered on whitespace, the returned range will be the same as the input (but still a copy).

Refer to baseFlowUtils for more information on how to import and use this function.

Arguments

  1. range

    (Required)

    The input range

  2. blueprint

    (Required)

    Type: Blueprint

    The blueprint in which to consider the range

  3. format

    (Required)

    Type: Format

    The format

  4. allowWordEdge

    (Optional)

    Type: Boolean

    True if positions on word edges are allowed

Returns

The resulting range