Johannes Rieken 2021-01-27 10:12:22 +01:00
parent 7b0cfdd04a
commit c246b5704f

View file

@ -139,12 +139,6 @@ export class NotebookEditor extends EditorPane {
const group = this.group!;
this._saveEditorViewState(this.input);
await super.setInput(input, options, context, token);
// Check for cancellation
if (token.isCancellationRequested) {
return undefined;
}
this._widgetDisposableStore.clear();
@ -161,6 +155,10 @@ export class NotebookEditor extends EditorPane {
this._widget.value!.layout(this._dimension, this._rootElement);
}
// only now `setInput` and yield/await. this is AFTER the actual widget is ready. This is very important
// so that others synchronously receive a notebook editor with the correct widget being set
await super.setInput(input, options, context, token);
const model = await input.resolve();
// Check for cancellation
if (token.isCancellationRequested) {