Skip to content

Commit

Permalink
Fix duplicate decorations getting created
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Mar 21, 2022
1 parent fe530d9 commit 23076ba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions addons/xterm-addon-search/src/SearchAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class SearchAddon implements ITerminalAddon {
private _disposeDecorations(): void {
this._resultDecorations.forEach(decorations => {
for (const d of decorations) {
console.log('dispose', d);
d.dispose();
}
});
Expand Down Expand Up @@ -189,9 +190,6 @@ export class SearchAddon implements ITerminalAddon {
}
}
}
if (result && searchOptions?.decorations) {
this._createResultDecoration(result, searchOptions?.decorations);
}
return result;
}

Expand Down Expand Up @@ -646,6 +644,7 @@ export class SearchAddon implements ITerminalAddon {
if (!marker || !decorations?.matchColor) {
return undefined;
}

const findResultDecoration = terminal.registerDecoration(
{ marker,
overviewRulerOptions: this._resultDecorations.get(marker.line) && !this._dataChanged ? undefined : { color: decorations.matchColor, position: 'center' }
Expand Down

0 comments on commit 23076ba

Please sign in to comment.