Skip to content

Commit d5e0905

Browse files
authored
register disposabls (#260238)
1 parent 6f97858 commit d5e0905

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class NotebookFindInputFilterButton extends Disposable {
180180
super();
181181
this._toggleStyles = options.toggleStyles;
182182

183-
this._filtersAction = new Action('notebookFindFilterAction', tooltip, 'notebook-filters ' + ThemeIcon.asClassName(filterIcon));
183+
this._filtersAction = this._register(new Action('notebookFindFilterAction', tooltip, 'notebook-filters ' + ThemeIcon.asClassName(filterIcon)));
184184
this._filtersAction.checked = false;
185185
this._filterButtonContainer = dom.$('.find-filter-button');
186186
this._filterButtonContainer.classList.add('monaco-custom-toggle');
@@ -347,12 +347,12 @@ export abstract class SimpleFindReplaceWidget extends Widget {
347347
const findHistoryConfig = this._configurationService.getValue<'never' | 'workspace'>('editor.find.history');
348348
const replaceHistoryConfig = this._configurationService.getValue<'never' | 'workspace'>('editor.find.replaceHistory');
349349

350-
this._filters = new NotebookFindFilters(findFilters.markupSource, findFilters.markupPreview, findFilters.codeSource, findFilters.codeOutput, { findScopeType: NotebookFindScopeType.None });
350+
this._filters = this._register(new NotebookFindFilters(findFilters.markupSource, findFilters.markupPreview, findFilters.codeSource, findFilters.codeOutput, { findScopeType: NotebookFindScopeType.None }));
351351
this._state.change({ filters: this._filters }, false);
352352

353-
this._filters.onDidChange(() => {
353+
this._register(this._filters.onDidChange(() => {
354354
this._state.change({ filters: this._filters }, false);
355-
});
355+
}));
356356

357357
this._domNode = document.createElement('div');
358358
this._domNode.classList.add('simple-fr-find-part-wrapper');
@@ -368,10 +368,10 @@ export abstract class SimpleFindReplaceWidget extends Widget {
368368
}));
369369

370370
this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));
371-
this._scopedContextKeyService = contextKeyService.createScoped(this._domNode);
371+
this._scopedContextKeyService = this._register(contextKeyService.createScoped(this._domNode));
372372

373373
const progressContainer = dom.$('.find-replace-progress');
374-
this._progressBar = new ProgressBar(progressContainer, defaultProgressBarStyles);
374+
this._progressBar = this._register(new ProgressBar(progressContainer, defaultProgressBarStyles));
375375
this._domNode.appendChild(progressContainer);
376376

377377
const isInteractiveWindow = contextKeyService.getContextKeyValue('notebookType') === 'interactive';
@@ -489,7 +489,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
489489
}));
490490
this.inSelectionToggle.domNode.style.display = 'inline';
491491

492-
this.inSelectionToggle.onChange(() => {
492+
this._register(this.inSelectionToggle.onChange(() => {
493493
const checked = this.inSelectionToggle.checked;
494494
if (checked) {
495495
// selection logic:
@@ -530,7 +530,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
530530
this.clearCellSelectionDecorations();
531531
this.clearTextSelectionDecorations();
532532
}
533-
});
533+
}));
534534

535535
const closeBtn = this._register(new SimpleButton({
536536
label: NLS_CLOSE_BTN_LABEL,

0 commit comments

Comments
 (0)