-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show all matches when searching #3698
Conversation
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); | ||
}); |
There was a problem hiding this comment.
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
setTimeout(() => { | ||
if (this._lastSearchOptions?.decorations && this._cachedSearchTerm && this._resultDecorations.size > 0 && this._lastSearchOptions) { | ||
this._highlightAllMatches(this._cachedSearchTerm, this._lastSearchOptions,'previous'); | ||
} | ||
}, 200); |
There was a problem hiding this comment.
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.
Co-authored-by: Daniel Imms <[email protected]>
An embedder may not want to enable it
Fixes #1653
Part of microsoft/vscode#134790