use set timeout

This commit is contained in:
meganrogge
2022-03-21 11:45:45 -04:00
parent 8ff34a6aee
commit 1098173908
+5 -4
View File
@@ -67,11 +67,12 @@ export class SearchAddon implements ITerminalAddon {
public activate(terminal: Terminal): void {
this._terminal = terminal;
this._onDataDisposable = this._terminal.onData(() => {
//TODO: debounce
this._dataChanged = true;
if (this._cachedSearchTerm && this._resultDecorations.size > 0 && this._lastSearchOptions) {
this._highlightAllMatches(this._cachedSearchTerm, this._lastSearchOptions,'previous');
}
setTimeout(() => {
if (this._cachedSearchTerm && this._resultDecorations.size > 0 && this._lastSearchOptions) {
this._highlightAllMatches(this._cachedSearchTerm, this._lastSearchOptions,'previous');
}
}, 200);
});
}