src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts/PieceTreeTextBufferFactory/create
class PieceTreeTextBufferFactory:	public create(defaultEOL: DefaultEndOfLine): { textBuffer: ITextBuffer; disposable: IDisposable } {
		const eol = this._getEOL(defaultEOL);
		const chunks = this._chunks;

		if (this._normalizeEOL &&
			((eol === '\r\n' && (this._cr > 0 || this._lf > 0))
				|| (eol === '\n' && (this._cr > 0 || this._crlf > 0)))
		) {
			// Normalize pieces
			for (let i = 0, len = chunks.length; i < len; i++) {
				const str = chunks[i].buffer.replace(/\r\n|\r|\n/g, eol);
				const newLineStart = createLineStartsFast(str);
				chunks[i] = new StringBuffer(str, newLineStart);
			}
		}

		const textBuffer = new PieceTreeTextBuffer(chunks, this._bom, eol, this._containsRTL, this._containsUnusualLineTerminators, this._isBasicASCII, this._normalizeEOL);
		return { textBuffer: textBuffer, disposable: textBuffer };
	}