Skip to content

Conversation

@meganrogge
Copy link
Member

@meganrogge meganrogge commented Mar 18, 2022

@meganrogge meganrogge self-assigned this Mar 18, 2022
@meganrogge meganrogge requested a review from Tyriar March 18, 2022 18:47
@meganrogge meganrogge added this to the 4.19.0 milestone Mar 18, 2022
@Tyriar Tyriar changed the title find all Show all matches when searching Mar 18, 2022
Comment on lines 69 to 76
this._onDataDisposable = this._terminal.onData(() => {
this._dataChanged = true;
setTimeout(() => {
if (this._lastSearchOptions?.decorations && this._cachedSearchTerm && this._resultDecorations.size > 0 && this._lastSearchOptions) {
this._highlightAllMatches(this._cachedSearchTerm, this._lastSearchOptions,'previous');
}
}, 200);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should get debounced to ensure we're not doing this every 200 ms, but only 200ms after no event

Comment on lines 71 to 75
setTimeout(() => {
if (this._lastSearchOptions?.decorations && this._cachedSearchTerm && this._resultDecorations.size > 0 && this._lastSearchOptions) {
this._highlightAllMatches(this._cachedSearchTerm, this._lastSearchOptions,'previous');
}
}, 200);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This create a new timeout on every onData event, there should only be a single timeout active at any time.

@Tyriar Tyriar merged commit dddde8e into xtermjs:master Mar 22, 2022
@meganrogge meganrogge deleted the findAll branch March 22, 2022 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search addon: Introduce a new selection type so that multiple ranges can be highlighted at once

2 participants