513
514
private _setValueFromTextBuffer(textBuffer: model.ITextBuffer, textBufferDisposable: IDisposable, reason: TextModelEditSource): void {
516
>
const oldFullModelRange = this.getFullModelRange();
517
>
const oldModelValueLength = this.getValueLengthInRange(oldFullModelRange);
518
>
const endLineNumber = this.getLineCount();
519
>
const endColumn = this.getLineMaxColumn(endLineNumber);
520
>
521
>
this._buffer = textBuffer;
522
>
this._bufferDisposable.dispose();
523
>
this._bufferDisposable = textBufferDisposable;
524
>
this._increaseVersionId();
525
>
526
>
// Destroy all my decorations
527
>
this._decorations = Object.create(null);
528
>
this._decorationsTree = new DecorationsTrees();
529
>
530
>
// Destroy my edit history and settings
531
>
this._commandManager.clear();
532
>
this._trimAutoWhitespaceLines = null;
533
>
534
>
this._emitContentChangedEvent(
535
>
new ModelRawContentChangedEvent(
536
>
[
537
>
new ModelRawFlush()
538
>
],
539
>
this._versionId,
540
>
false,
541
>
false
542
>
),
543
>
this._createContentChanged2(new Range(1, 1, endLineNumber, endColumn), 0, oldModelValueLength, new Position(endLineNumber, endColumn), this.getValue(), false, false, true, false, reason)
544
>
);
545
>
}
546
547
public setEOL(eol: model.EndOfLineSequence): void {