mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Ensure marker is disposed when decoration is
This commit is contained in:
@@ -601,6 +601,7 @@ export class SearchAddon implements ITerminalAddon {
|
||||
if (marker) {
|
||||
this._selectedDecoration = terminal.registerDecoration({ marker, overviewRulerOptions: { color: decorations.selectedColor } });
|
||||
this._selectedDecoration?.onRender((e) => this._applyStyles(e, decorations.selectedColor, result));
|
||||
this._selectedDecoration?.onDispose(() => marker.dispose());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,6 +651,7 @@ export class SearchAddon implements ITerminalAddon {
|
||||
overviewRulerOptions: this._resultDecorations.get(marker.line) && !this._dataChanged ? undefined : { color: decorations.matchColor, position: 'center' }
|
||||
});
|
||||
findResultDecoration?.onRender((e) => this._applyStyles(e, decorations.matchColor, result));
|
||||
findResultDecoration?.onDispose(() => marker.dispose());
|
||||
return findResultDecoration;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user