refine name for clearDecorations param (#3757)

This commit is contained in:
Megan Rogge
2022-05-02 14:20:25 -07:00
committed by GitHub
parent 1687d06f1c
commit 218745ab85
+2 -6
View File
@@ -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;
}
}