Merge pull request #3768 from Tyriar/clean_up

Correct param names/jsdoc in SearchAddon
This commit is contained in:
Daniel Imms
2022-05-09 12:45:03 -07:00
committed by GitHub
+5 -6
View File
@@ -693,7 +693,6 @@ export class SearchAddon implements ITerminalAddon {
* @param element the decoration's element
* @param backgroundColor the background color to apply
* @param borderColor the border color to apply
* @param result the search result associated with the decoration
* @returns
*/
private _applyStyles(element: HTMLElement, backgroundColor: string | undefined, borderColor: string | undefined): void {
@@ -714,13 +713,13 @@ export class SearchAddon implements ITerminalAddon {
/**
* Creates a decoration for the result and applies styles
* @param result the search result for which to create the decoration
* @param color the color to use for the decoration
* @param options the options for the decoration
* @returns the {@link IDecoration} or undefined if the marker has already been disposed of
*/
private _createResultDecoration(result: ISearchResult, decorations: ISearchDecorationOptions): IDecoration | undefined {
private _createResultDecoration(result: ISearchResult, options: ISearchDecorationOptions): IDecoration | undefined {
const terminal = this._terminal!;
const marker = terminal.registerMarker(-terminal.buffer.active.baseY - terminal.buffer.active.cursorY + result.row);
if (!marker || !decorations?.matchOverviewRuler) {
if (!marker || !options?.matchOverviewRuler) {
return undefined;
}
const findResultDecoration = terminal.registerDecoration({
@@ -728,10 +727,10 @@ export class SearchAddon implements ITerminalAddon {
x: result.col,
width: result.size,
overviewRulerOptions: this._resultDecorations?.get(marker.line) ? undefined : {
color: decorations.matchOverviewRuler, position: 'center'
color: options.matchOverviewRuler, position: 'center'
}
});
findResultDecoration?.onRender((e) => this._applyStyles(e, decorations.matchBackground, decorations.matchBorder));
findResultDecoration?.onRender((e) => this._applyStyles(e, options.matchBackground, options.matchBorder));
findResultDecoration?.onDispose(() => marker.dispose());
return findResultDecoration;
}