Fix duplicate decorations getting created
This commit is contained in:
@@ -92,6 +92,7 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
private _disposeDecorations(): void {
|
private _disposeDecorations(): void {
|
||||||
this._resultDecorations.forEach(decorations => {
|
this._resultDecorations.forEach(decorations => {
|
||||||
for (const d of decorations) {
|
for (const d of decorations) {
|
||||||
|
console.log('dispose', d);
|
||||||
d.dispose();
|
d.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -189,9 +190,6 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result && searchOptions?.decorations) {
|
|
||||||
this._createResultDecoration(result, searchOptions?.decorations);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,6 +644,7 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
if (!marker || !decorations?.matchColor) {
|
if (!marker || !decorations?.matchColor) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const findResultDecoration = terminal.registerDecoration(
|
const findResultDecoration = terminal.registerDecoration(
|
||||||
{ marker,
|
{ marker,
|
||||||
overviewRulerOptions: this._resultDecorations.get(marker.line) && !this._dataChanged ? undefined : { color: decorations.matchColor, position: 'center' }
|
overviewRulerOptions: this._resultDecorations.get(marker.line) && !this._dataChanged ? undefined : { color: decorations.matchColor, position: 'center' }
|
||||||
|
|||||||
Reference in New Issue
Block a user