src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts/toTextMap
function toTextMap(textEditInfos: TextEditInfo[]): TextMapping[] {
	const result: TextMapping[] = [];
	let lastOffset = lengthZero;
	for (const textEditInfo of textEditInfos) {
		const spaceLength = lengthDiffNonNegative(lastOffset, textEditInfo.startOffset);
		if (!lengthIsZero(spaceLength)) {
			result.push({ oldLength: spaceLength });
		}

		const oldLength = lengthDiffNonNegative(textEditInfo.startOffset, textEditInfo.endOffset);
		result.push({ oldLength, newLength: textEditInfo.newLength });
		lastOffset = textEditInfo.endOffset;
	}
	return result;
}