Fix #98841. Open file should only emit document open event, no cells change event.

This commit is contained in:
rebornix
2020-06-02 15:13:15 -07:00
parent 8e45a2f4b5
commit adae0e5b4e
5 changed files with 58 additions and 26 deletions

View File

@@ -476,14 +476,16 @@ export class MainThreadNotebookController implements IMainNotebookController {
document.textModel.metadata = backup.metadata;
document.textModel.languages = backup.languages;
// restored from backup, update the text model without emitting any event to exthost
document.textModel.$applyEdit(document.textModel.versionId, [
{
editType: CellEditType.Insert,
index: 0,
cells: backup.cells || []
}
]);
], false);
// create document in ext host with cells data
await this._mainThreadNotebook.addNotebookDocument({
viewType: document.viewType,
handle: document.handle,