From b1c9e43ecf33d80a67e16115a167ade8378733da Mon Sep 17 00:00:00 2001 From: colin-grant-work Date: Fri, 14 Apr 2023 13:33:10 -0600 Subject: [PATCH] In MonacoEditorModel, use value for snapshot (#12418) --- packages/monaco/src/browser/monaco-editor-model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/monaco/src/browser/monaco-editor-model.ts b/packages/monaco/src/browser/monaco-editor-model.ts index cd0f4b36e0e48..88a113bf372b7 100644 --- a/packages/monaco/src/browser/monaco-editor-model.ts +++ b/packages/monaco/src/browser/monaco-editor-model.ts @@ -550,7 +550,7 @@ export class MonacoEditorModel implements IResolvedTextEditorModel, TextEditorDo } const contentLength = this.model.getValueLength(); - const content = this.model.createSnapshot() || this.model.getValue(); + const content = this.model.getValue(); try { const encoding = this.getEncoding(); const version = this.resourceVersion; @@ -656,7 +656,7 @@ export class MonacoEditorModel implements IResolvedTextEditorModel, TextEditorDo } createSnapshot(preserveBOM?: boolean): ITextSnapshot { - return this.model.createSnapshot(preserveBOM); + return { read: () => this.model.getValue(undefined, preserveBOM) }; } applySnapshot(snapshot: Saveable.Snapshot): void {