Merge branch 'master' into bg_decorations

This commit is contained in:
Daniel Imms
2022-05-10 11:50:01 -07:00
committed by GitHub
3 changed files with 20 additions and 17 deletions
+3 -4
View File
@@ -128,7 +128,7 @@ export class SearchAddon implements ITerminalAddon {
}
this._lastSearchOptions = searchOptions;
if (searchOptions?.decorations) {
if (this._resultIndex || this._cachedSearchTerm && term !== this._cachedSearchTerm) {
if (this._resultIndex !== undefined || this._cachedSearchTerm && term !== this._cachedSearchTerm) {
this._highlightAllMatches(term, searchOptions);
}
}
@@ -306,7 +306,7 @@ export class SearchAddon implements ITerminalAddon {
throw new Error('Cannot use addon until it has been loaded');
}
this._lastSearchOptions = searchOptions;
if (searchOptions?.decorations && (this._resultIndex || term !== this._cachedSearchTerm)) {
if (searchOptions?.decorations && (this._resultIndex !== undefined || term !== this._cachedSearchTerm)) {
this._highlightAllMatches(term, searchOptions);
}
return this._fireResults(term, this._findPreviousAndSelect(term, searchOptions), searchOptions);
@@ -694,7 +694,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, borderColor: string | undefined): void {
@@ -712,7 +711,7 @@ 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, options: ISearchDecorationOptions): IDecoration | undefined {