Fix SortedList.values iteration and general dec lifecycle fixes

Fixes #4652
This commit is contained in:
Daniel Imms
2023-08-13 10:42:45 -07:00
parent 5890029f71
commit 70f6fa2bc9
6 changed files with 26 additions and 25 deletions
+3 -9
View File
@@ -68,8 +68,6 @@ export class SearchAddon extends Disposable implements ITerminalAddon {
private _highlightDecorations: IHighlight[] = [];
private _selectedDecoration: IHighlight | undefined;
private _highlightLimit: number;
private _onDataDisposable: IDisposable | undefined;
private _onResizeDisposable: IDisposable | undefined;
private _lastSearchOptions: ISearchOptions | undefined;
private _highlightTimeout: number | undefined;
/**
@@ -93,13 +91,9 @@ export class SearchAddon extends Disposable implements ITerminalAddon {
public activate(terminal: Terminal): void {
this._terminal = terminal;
this._onDataDisposable = this.register(this._terminal.onWriteParsed(() => this._updateMatches()));
this._onResizeDisposable = this.register(this._terminal.onResize(() => this._updateMatches()));
this.register(toDisposable(() => {
this.clearDecorations();
this._onDataDisposable?.dispose();
this._onResizeDisposable?.dispose();
}));
this.register(this._terminal.onWriteParsed(() => this._updateMatches()));
this.register(this._terminal.onResize(() => this._updateMatches()));
this.register(toDisposable(() => this.clearDecorations()));
}
private _updateMatches(): void {