552
return;
553
}
555
>
const oldFullModelRange = this.getFullModelRange();
556
>
const oldModelValueLength = this.getValueLengthInRange(oldFullModelRange);
557
>
const endLineNumber = this.getLineCount();
558
>
const endColumn = this.getLineMaxColumn(endLineNumber);
559
>
560
>
this._onBeforeEOLChange();
561
>
this._buffer.setEOL(newEOL);
562
>
this._increaseVersionId();
563
>
this._onAfterEOLChange();
564
>
565
>
this._emitContentChangedEvent(
566
>
new ModelRawContentChangedEvent(
567
>
[
568
>
new ModelRawEOLChanged()
569
>
],
570
>
this._versionId,
571
>
false,
572
>
false
573
>
),
574
>
this._createContentChanged2(new Range(1, 1, endLineNumber, endColumn), 0, oldModelValueLength, new Position(endLineNumber, endColumn), this.getValue(), false, false, false, true, EditSources.eolChange())
575
>
);
576
}
577
578
private _onBeforeEOLChange(): void {
579
>
// Ensure all decorations get their `range` set.
textModel.ts
580
>
this._decorationsTree.ensureAllNodesHaveRanges(this);
581
>
}
582
583
private _onAfterEOLChange(): void {
585
>
const versionId = this.getVersionId();
586
>
const allDecorations = this._decorationsTree.collectNodesPostOrder();
587
>
for (let i = 0, len = allDecorations.length; i < len; i++) {
588
const node = allDecorations[i];
589
const range = node.range!; // the range is defined due to `_onBeforeEOLChange`