fix move editor group issue (#18242)

This commit is contained in:
Alan Ren
2022-02-07 18:04:57 -08:00
committed by GitHub
parent bba1ea32a8
commit 6ba746e570

View File

@@ -64,6 +64,7 @@ export class DesignerScriptEditor extends BaseTextEditor implements DesignerText
this.setInput(this._editorInput, undefined, undefined).catch(onUnexpectedError); this.setInput(this._editorInput, undefined, undefined).catch(onUnexpectedError);
this._editorInput.resolve().then((model) => { this._editorInput.resolve().then((model) => {
this._editorModel = model.textEditorModel; this._editorModel = model.textEditorModel;
this.updateEditor();
}); });
} }
@@ -111,8 +112,14 @@ export class DesignerScriptEditor extends BaseTextEditor implements DesignerText
set content(val: string) { set content(val: string) {
this._content = val; this._content = val;
this.updateEditor();
}
private updateEditor(): void {
if (this._editorModel) {
this._modelService.updateModel(this._editorModel, this._content); this._modelService.updateModel(this._editorModel, this._content);
this._untitledTextEditorModel.setDirty(false); this._untitledTextEditorModel.setDirty(false);
this.layout(new DOM.Dimension(this._container.clientWidth, this._container.clientHeight)); this.layout(new DOM.Dimension(this._container.clientWidth, this._container.clientHeight));
} }
}
} }