Skip to main content

Module: util/selectionUtils

Functions

selectionWithEditorFromRange

selectionWithEditorFromRange(selection, range): SelectionWithEditor

Parameters

NameType
selectionSelectionWithEditor
rangeRange

Returns

SelectionWithEditor

Defined in

util/selectionUtils.ts:4


shrinkRangeToFitContent

shrinkRangeToFitContent(editor, range): Range

Return a copy of range excluding any leading or trailing whitespace. If range contains only whitespace or is empty range will be returned unchanged.

Parameters

NameTypeDescription
editorTextEditorThe text editor to use
rangeRangeThe range to shrink down

Returns

Range

A new range equal or smaller to range

Defined in

util/selectionUtils.ts:39