From 218745ab85fe1b6a6278b64b022302f299ba969c Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Mon, 2 May 2022 14:20:25 -0700 Subject: [PATCH] refine name for clearDecorations param (#3757) --- addons/xterm-addon-search/src/SearchAddon.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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; } }