@@ -1385,40 +1385,44 @@ export class ModifiedElement extends AbstractElementRenderer {
1385
1385
1386
1386
this . _outputLeftContainer = DOM . append ( this . _outputViewContainer ! , DOM . $ ( '.output-view-container-left' ) ) ;
1387
1387
this . _outputRightContainer = DOM . append ( this . _outputViewContainer ! , DOM . $ ( '.output-view-container-right' ) ) ;
1388
+
1389
+ if ( this . cell . checkIfOutputsModified ( ) ) {
1390
+ const originalOutputRenderListener = this . notebookEditor . onDidDynamicOutputRendered ( e => {
1391
+ if ( e . cell . uri . toString ( ) === this . cell . original . uri . toString ( ) ) {
1392
+ this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Original , this . cell . original . id , [ 'nb-cellDeleted' ] , [ ] ) ;
1393
+ originalOutputRenderListener . dispose ( ) ;
1394
+ }
1395
+ } ) ;
1396
+
1397
+ const modifiedOutputRenderListener = this . notebookEditor . onDidDynamicOutputRendered ( e => {
1398
+ if ( e . cell . uri . toString ( ) === this . cell . modified . uri . toString ( ) ) {
1399
+ this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Modified , this . cell . modified . id , [ 'nb-cellAdded' ] , [ ] ) ;
1400
+ modifiedOutputRenderListener . dispose ( ) ;
1401
+ }
1402
+ } ) ;
1403
+
1404
+ this . _register ( originalOutputRenderListener ) ;
1405
+ this . _register ( modifiedOutputRenderListener ) ;
1406
+ }
1407
+
1388
1408
// We should use the original text model here
1389
1409
this . _outputLeftView = this . instantiationService . createInstance ( OutputContainer , this . notebookEditor , this . notebookEditor . textModel ! , this . cell , this . cell . original ! , DiffSide . Original , this . _outputLeftContainer ! ) ;
1390
1410
this . _outputLeftView . render ( ) ;
1391
1411
this . _register ( this . _outputLeftView ) ;
1392
1412
this . _outputRightView = this . instantiationService . createInstance ( OutputContainer , this . notebookEditor , this . notebookEditor . textModel ! , this . cell , this . cell . modified ! , DiffSide . Modified , this . _outputRightContainer ! ) ;
1393
1413
this . _outputRightView . render ( ) ;
1394
1414
this . _register ( this . _outputRightView ) ;
1395
-
1396
- const originalOutputRenderListener = this . notebookEditor . onDidDynamicOutputRendered ( e => {
1397
- if ( e . cell . uri . toString ( ) === this . cell . original . uri . toString ( ) ) {
1398
- this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Original , this . cell . original . id , [ 'nb-cellDeleted' ] , [ ] ) ;
1399
- originalOutputRenderListener . dispose ( ) ;
1400
- }
1401
- } ) ;
1402
-
1403
- const modifiedOutputRenderListener = this . notebookEditor . onDidDynamicOutputRendered ( e => {
1404
- if ( e . cell . uri . toString ( ) === this . cell . modified . uri . toString ( ) ) {
1405
- this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Modified , this . cell . modified . id , [ 'nb-cellAdded' ] , [ ] ) ;
1406
- modifiedOutputRenderListener . dispose ( ) ;
1407
- }
1408
- } ) ;
1409
-
1410
- this . _register ( originalOutputRenderListener ) ;
1411
- this . _register ( modifiedOutputRenderListener ) ;
1412
-
1413
1415
this . _decorate ( ) ;
1414
1416
}
1415
1417
1416
1418
this . _outputViewContainer . style . display = 'block' ;
1417
1419
}
1418
1420
1419
1421
_decorate ( ) {
1420
- this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Original , this . cell . original . id , [ 'nb-cellDeleted' ] , [ ] ) ;
1421
- this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Modified , this . cell . modified . id , [ 'nb-cellAdded' ] , [ ] ) ;
1422
+ if ( this . cell . checkIfOutputsModified ( ) ) {
1423
+ this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Original , this . cell . original . id , [ 'nb-cellDeleted' ] , [ ] ) ;
1424
+ this . notebookEditor . deltaCellOutputContainerClassNames ( DiffSide . Modified , this . cell . modified . id , [ 'nb-cellAdded' ] , [ ] ) ;
1425
+ }
1422
1426
}
1423
1427
1424
1428
_showOutputsRenderer ( ) {
0 commit comments