File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
src/client/datascience/interactive-ipynb Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -489,6 +489,17 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor {
489
489
// VS code is telling us to broadcast this to our UI. Tell the UI about the new change
490
490
await this . postMessage ( InteractiveWindowMessages . UpdateModel , change ) ;
491
491
}
492
+
493
+ // Use the current state of the model to indicate dirty (not the message itself)
494
+ if ( this . _model && change . newDirty !== change . oldDirty ) {
495
+ this . modifiedEvent . fire ( ) ;
496
+ if ( this . _model . isDirty ) {
497
+ await this . postMessage ( InteractiveWindowMessages . NotebookDirty ) ;
498
+ } else {
499
+ // Then tell the UI
500
+ await this . postMessage ( InteractiveWindowMessages . NotebookClean ) ;
501
+ }
502
+ }
492
503
}
493
504
private interruptExecution ( ) {
494
505
this . executeCancelTokens . forEach ( t => t . cancel ( ) ) ;
@@ -524,19 +535,6 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor {
524
535
false ,
525
536
cancelToken
526
537
) ;
527
-
528
- if ( ! cancelToken . isCancellationRequested ) {
529
- // Activate the other side, and send as if came from a file
530
- await this . editorProvider . show ( this . file ) ;
531
- this . shareMessage ( InteractiveWindowMessages . RemoteReexecuteCode , {
532
- code : entry . code ,
533
- file : Identifiers . EmptyFileName ,
534
- line : 0 ,
535
- id : entry . cell . id ,
536
- originator : this . id ,
537
- debug : false
538
- } ) ;
539
- }
540
538
}
541
539
} catch ( exc ) {
542
540
// Make this error our cell output
You can’t perform that action at this time.
0 commit comments