Skip to content

Commit

Permalink
always update overview ruler decorations (#3733)
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge authored Apr 13, 2022
1 parent 85b5161 commit e98b631
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions addons/xterm-addon-search/src/SearchAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const LINES_CACHE_TIME_TO_LIVE = 15 * 1000; // 15 secs

export class SearchAddon implements ITerminalAddon {
private _terminal: Terminal | undefined;
private _dataChanged: boolean = false;
private _cachedSearchTerm: string | undefined;
private _selectedDecoration: IDecoration | undefined;
private _resultDecorations: Map<number, IDecoration[]> | undefined;
Expand All @@ -77,7 +76,6 @@ export class SearchAddon implements ITerminalAddon {
public activate(terminal: Terminal): void {
this._terminal = terminal;
this._onDataDisposable = this._terminal.onData(() => {
this._dataChanged = true;
if (this._highlightTimeout) {
window.clearTimeout(this._highlightTimeout);
}
Expand Down Expand Up @@ -106,7 +104,6 @@ export class SearchAddon implements ITerminalAddon {
this._cachedSearchTerm = undefined;
this._searchResults = undefined;
this._resultDecorations = undefined;
this._dataChanged = true;
this._resultIndex = undefined;
}

Expand Down Expand Up @@ -169,9 +166,6 @@ export class SearchAddon implements ITerminalAddon {
resultDecorations.set(resultDecoration.marker.line, decorationsForLine);
}
});
if (this._dataChanged) {
this._dataChanged = false;
}
if (this._searchResults.size > 0) {
this._cachedSearchTerm = term;
}
Expand Down Expand Up @@ -710,7 +704,7 @@ export class SearchAddon implements ITerminalAddon {
marker,
x: result.col,
width: result.size,
overviewRulerOptions: this._resultDecorations?.get(marker.line) && !this._dataChanged ? undefined : {
overviewRulerOptions: this._resultDecorations?.get(marker.line) ? undefined : {
color: decorations.matchOverviewRuler, position: 'center'
}
});
Expand Down

0 comments on commit e98b631

Please sign in to comment.