Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions src/client/datascience/interactive-ipynb/nativeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,17 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor {
// VS code is telling us to broadcast this to our UI. Tell the UI about the new change
await this.postMessage(InteractiveWindowMessages.UpdateModel, change);
}

// Use the current state of the model to indicate dirty (not the message itself)
if (this._model && change.newDirty !== change.oldDirty) {
this.modifiedEvent.fire();
if (this._model.isDirty) {
await this.postMessage(InteractiveWindowMessages.NotebookDirty);
} else {
// Then tell the UI
await this.postMessage(InteractiveWindowMessages.NotebookClean);
}
}
}
private interruptExecution() {
this.executeCancelTokens.forEach(t => t.cancel());
Expand Down Expand Up @@ -524,19 +535,6 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor {
false,
cancelToken
);

if (!cancelToken.isCancellationRequested) {
// Activate the other side, and send as if came from a file
await this.editorProvider.show(this.file);
this.shareMessage(InteractiveWindowMessages.RemoteReexecuteCode, {
code: entry.code,
file: Identifiers.EmptyFileName,
line: 0,
id: entry.cell.id,
originator: this.id,
debug: false
});
}
}
} catch (exc) {
// Make this error our cell output
Expand Down