Skip to content

Commit

Permalink
In MonacoEditorModel, use value for snapshot (#12418)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-grant-work authored Apr 14, 2023
1 parent 6c7f3b1 commit b1c9e43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/monaco/src/browser/monaco-editor-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b1c9e43

Please sign in to comment.