Skip to content

Commit

Permalink
fix: editor save issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaaaash committed Dec 22, 2021
1 parent 2d25c3e commit 8b79a73
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ export class EditorDocumentModel extends Disposable implements IEditorDocumentMo

private listenTo(monacoModel: ITextModel) {
monacoModel.onDidChangeContent((e) => {
console.log('onDidChangeContent', e);
if (e.isFlush) {
console.log('content changed by flush', this.uri.toString());
}
if (e.changes && e.changes.length > 0) {
this.dirtyChanges.push({
fromVersionId: this._previousVersionId,
Expand Down Expand Up @@ -450,6 +454,7 @@ export class EditorDocumentModel extends Disposable implements IEditorDocumentMo
{
range: this.monacoModel.getFullModelRange(),
text: content,
forceMoveMarkers: true,
},
],
() => [],
Expand All @@ -460,6 +465,7 @@ export class EditorDocumentModel extends Disposable implements IEditorDocumentMo
if (setPersist) {
this.setPersist(this.monacoModel.getAlternativeVersionId());
this.baseContent = content;
this.dirtyChanges = [];
}
}

Expand Down

0 comments on commit 8b79a73

Please sign in to comment.