Support setting the layer of a decoration

Fixes #3778
This commit is contained in:
Daniel Imms
2022-05-12 10:51:11 -07:00
parent bc4158c9b8
commit 7b4423819e
10 changed files with 62 additions and 8 deletions
+7 -1
View File
@@ -115,6 +115,11 @@ export class SearchAddon implements ITerminalAddon {
}
}
public clearActiveDecoration(): void {
this._selectedDecoration?.dispose();
this._selectedDecoration = undefined;
}
/**
* Find the next instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing.
@@ -655,7 +660,7 @@ export class SearchAddon implements ITerminalAddon {
*/
private _selectResult(result: ISearchResult | undefined, options?: ISearchDecorationOptions, noScroll?: boolean): boolean {
const terminal = this._terminal!;
this._selectedDecoration?.dispose();
this.clearActiveDecoration();
if (!result) {
terminal.clearSelection();
return false;
@@ -669,6 +674,7 @@ export class SearchAddon implements ITerminalAddon {
x: result.col,
width: result.size,
backgroundColor: options.activeMatchBackground,
layer: 'top',
overviewRulerOptions: {
color: options.activeMatchColorOverviewRuler
}