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.
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.
Seems like overriding
DocView:scroll_to_line
is enough to fix the issue with the projectsearch plugin. Any reason to also callLineWrapping.update_docview_breaks
onDocView:scroll_to_make_visible
? I'm worried that callingLineWrapping.reconstruct_breaks
(which is called by update_docview_breaks) will hurt performance more since it is already been called on eachupdate()
.Otherwise the fix is good.
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.
I am under the impression that
update_docview_breaks
will only callreconstruct_breaks
if necessary, so only once. It'll check the width a few extra times, but that's relatively harmless, IMO.I added it to the other scroll function as well in case any other plugins or modifications use it, to make sure everything is as robust as possible. One function call with an if statement is an acceptable overhead, I think.
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.
I did some core.log testing directly on
reconstruct_breaks
and it was executing its code on every call, it doesn't seems to implement any state tracking for now. And adding the update breaks to scroll visible just increases the amount of times it gets called when manually scrolling the docviewThere 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.
my bad, that isn't correct... it is only been triggered now on scroll hover with the call to
LineWrapping.update_docview_breaks(self)
onDocView:scroll_to_make_visible
Edit: Actually I'm wrong again, should get some sleep xD