mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Fix duplicate decorations getting created
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
@@ -189,9 +190,6 @@ export class SearchAddon implements ITerminalAddon {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result && searchOptions?.decorations) {
|
||||
this._createResultDecoration(result, searchOptions?.decorations);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -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' }
|
||||
|
||||
Reference in New Issue
Block a user