Skip to main content

Module: core/updateSelections/getUpdatedText

Functions

getUpdatedText

getUpdatedText(changeEventInfo, rangeInfo, newOffsets): string

Updates the text of the given rangeInfo to take into account the given change.

The process is to first include any text from the original range that is before the range of the change, then add the text of the change, then add any text that trails the original change range. Then we take a substring corresponding to the range's new offsets.

Parameters

NameTypeDescription
changeEventInfoChangeEventInfoThe change to incorporate
rangeInfoFullRangeInfoThe rangeInfo to update
newOffsetsRangeOffsetsThe new offsets that the rangeInfo will have

Returns

string

The new text of the range

Defined in

core/updateSelections/getUpdatedText.ts:20