mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
mark untitled notebooks as dirty by default, don't hold on to untitled notebooks eagerly, https://github.com/microsoft/vscode/issues/121974
This commit is contained in:
@@ -132,7 +132,17 @@ export class MainThreadNotebookDocuments implements MainThreadNotebookDocumentsS
|
||||
}
|
||||
|
||||
const ref = await this._notebookEditorModelResolverService.resolve(uri, options.viewType);
|
||||
this._modelReferenceCollection.add(ref.object.resource, ref);
|
||||
|
||||
// untitled notebooks are disposed when they get saved. we should not hold a reference
|
||||
// to such a disposed notebook and therefore dispose the reference as well
|
||||
ref.object.notebook.onWillDispose(() => {
|
||||
ref.dispose();
|
||||
});
|
||||
|
||||
// untitled notebooks are dirty by default
|
||||
this._proxy.$acceptDirtyStateChanged(uri, true);
|
||||
|
||||
// apply content changes... slightly HACKY -> this triggers a change event
|
||||
if (options.content) {
|
||||
ref.object.notebook.reset(
|
||||
options.content.cells,
|
||||
|
||||
Reference in New Issue
Block a user