src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts/PieceTreeTextBuffer/_getInverseEditRange
class PieceTreeTextBuffer:	public static _getInverseEditRange(range: Range, text: string) {
		const startLineNumber = range.startLineNumber;
		const startColumn = range.startColumn;
		const [eolCount, firstLineLength, lastLineLength] = countEOL(text);
		let resultRange: Range;

		if (text.length > 0) {
			// the operation inserts something
			const lineCount = eolCount + 1;

			if (lineCount === 1) {
				// single line insert
				resultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn + firstLineLength);
			} else {
				// multi line insert
				resultRange = new Range(startLineNumber, startColumn, startLineNumber + lineCount - 1, lastLineLength + 1);
			}
		} else {
			// There is nothing to insert
			resultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn);
		}

		return resultRange;
	}