diff --git a/addons/xterm-addon-search/src/SearchAddon.ts b/addons/xterm-addon-search/src/SearchAddon.ts index 801da30a..345b9153 100644 --- a/addons/xterm-addon-search/src/SearchAddon.ts +++ b/addons/xterm-addon-search/src/SearchAddon.ts @@ -99,7 +99,7 @@ export class SearchAddon implements ITerminalAddon { this._onResizeDisposable?.dispose(); } - public clearDecorations(internal?: boolean): void { + public clearDecorations(retainCachedSearchTerm?: boolean): void { this._selectedDecoration?.dispose(); this._searchResults?.clear(); this._resultDecorations?.forEach(decorations => { @@ -110,11 +110,7 @@ export class SearchAddon implements ITerminalAddon { this._resultDecorations?.clear(); this._searchResults = undefined; this._resultDecorations = undefined; - if (!internal) { - // we want to keep _cachedSearchTerm defined if this is - // an internal call - // so that when the buffer changes, - // we can use that to search for new matches + if (!retainCachedSearchTerm) { this._cachedSearchTerm = undefined; } }