@@ -209,7 +209,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
209209
210210 this . _editorWorkerService = editorWorkerService ;
211211 this . _codeEditorService = codeEditorService ;
212- this . _contextKeyService = contextKeyService . createScoped ( domElement ) ;
212+ this . _contextKeyService = this . _register ( contextKeyService . createScoped ( domElement ) ) ;
213213 this . _contextKeyService . createKey ( 'isInDiffEditor' , true ) ;
214214 this . _themeService = themeService ;
215215 this . _notificationService = notificationService ;
@@ -313,14 +313,14 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
313313 this . _setStrategy ( new DiffEdtorWidgetInline ( this . _createDataSource ( ) , this . _enableSplitViewResizing ) ) ;
314314 }
315315
316- this . _codeEditorService . addDiffEditor ( this ) ;
317-
318316 this . _register ( themeService . onThemeChange ( t => {
319317 if ( this . _strategy && this . _strategy . applyColors ( t ) ) {
320318 this . _updateDecorationsRunner . schedule ( ) ;
321319 }
322320 this . _containerDomElement . className = DiffEditorWidget . _getClassName ( this . _themeService . getTheme ( ) , this . _renderSideBySide ) ;
323321 } ) ) ;
322+
323+ this . _codeEditorService . addDiffEditor ( this ) ;
324324 }
325325
326326 public get ignoreTrimWhitespace ( ) : boolean {
@@ -465,20 +465,37 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
465465 public dispose ( ) : void {
466466 this . _codeEditorService . removeDiffEditor ( this ) ;
467467
468+ if ( this . _beginUpdateDecorationsTimeout !== - 1 ) {
469+ window . clearTimeout ( this . _beginUpdateDecorationsTimeout ) ;
470+ this . _beginUpdateDecorationsTimeout = - 1 ;
471+ }
472+
468473 window . clearInterval ( this . _measureDomElementToken ) ;
469474
470475 this . _cleanViewZonesAndDecorations ( ) ;
471476
477+ this . _overviewDomElement . removeChild ( this . _originalOverviewRuler . getDomNode ( ) ) ;
472478 this . _originalOverviewRuler . dispose ( ) ;
479+ this . _overviewDomElement . removeChild ( this . _modifiedOverviewRuler . getDomNode ( ) ) ;
473480 this . _modifiedOverviewRuler . dispose ( ) ;
481+ this . _overviewDomElement . removeChild ( this . _overviewViewportDomElement . domNode ) ;
482+ this . _containerDomElement . removeChild ( this . _overviewDomElement ) ;
474483
484+ this . _containerDomElement . removeChild ( this . _originalDomNode ) ;
475485 this . originalEditor . dispose ( ) ;
486+
487+ this . _containerDomElement . removeChild ( this . _modifiedDomNode ) ;
476488 this . modifiedEditor . dispose ( ) ;
477489
478490 this . _strategy . dispose ( ) ;
479491
492+ this . _containerDomElement . removeChild ( this . _reviewPane . domNode . domNode ) ;
493+ this . _containerDomElement . removeChild ( this . _reviewPane . shadow . domNode ) ;
494+ this . _containerDomElement . removeChild ( this . _reviewPane . actionBarContainer . domNode ) ;
480495 this . _reviewPane . dispose ( ) ;
481496
497+ this . _domElement . removeChild ( this . _containerDomElement ) ;
498+
482499 this . _onDidDispose . fire ( ) ;
483500
484501 super . dispose ( ) ;
0 commit comments