Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix search constantly triggering a scroll #17132
Fix search constantly triggering a scroll #17132
Changes from 1 commit
162ff43
a3b560b
430d116
b605123
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
right?
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.
No, actually the comment is correct, but the boolean logic inside the function is very difficult to read. Basically, if
resetOnly
is true thenif (searchInvalidated || !resetOnly)
is only entered ifsearchInvalidated
is true. IfsearchInvalidated
is true then onlyReset()
will be called.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.
oh yea that's hard to parse
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.
won't
oldResults
be empty if we aren't invalidating? i guess I don't understandThere 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.
You mean what happens if
IsStale()
returned false and we didn't callReset()
?TriggerSearchHighlight
is basically a "refresh all these areas" call. Normally we need to refresh all current areas, which is whyoldResults
is empty. It gets the current areas directly fromIRenderData
(previously set bySetSearchHighlights
). During a resetoldResults
contains the previous areas as well, since those aren't highlighted anymore = dirty.Now that I think about it, I think we could also just remove the parameter to
TriggerSearchHighlight
and simply call it once before callingReset()
(= invalidate all the old highlights) and then once after (= all the new and current highlights).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.
Nice 😃
TriggerSearchHighlight() also isn't completely correct in that the old highlights are supposed to be invalidated w.r.t old line renditions, but we currently don't store old line renditions so we're just using the current line renditions. I'm sure this can be fixed with buffer snapshot based rendering where we would pass in the line rendition from the current snapshot of the buffer that render engine has access to.