only highlight all matches when decorations are requested

This commit is contained in:
meganrogge
2022-03-21 13:07:25 -04:00
parent 1098173908
commit 97e4af3707
+1 -1
View File
@@ -69,7 +69,7 @@ export class SearchAddon implements ITerminalAddon {
this._onDataDisposable = this._terminal.onData(() => {
this._dataChanged = true;
setTimeout(() => {
if (this._cachedSearchTerm && this._resultDecorations.size > 0 && this._lastSearchOptions) {
if (this._lastSearchOptions?.decorations && this._cachedSearchTerm && this._resultDecorations.size > 0 && this._lastSearchOptions) {
this._highlightAllMatches(this._cachedSearchTerm, this._lastSearchOptions,'previous');
}
}, 200);