This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Smarter line clipping in Find in Files#9743
Merged
prafulVaishnav merged 2 commits intoadobe:masterfrom Jan 23, 2015
Merged
Conversation
prafulVaishnav
added a commit
that referenced
this pull request
Jan 23, 2015
Smarter line clipping in Find in Files
Member
There was a problem hiding this comment.
@marcelgerber I think this might run into some bugs with matches that span multiple lines. The code here still assumes the start ch is on the first line of the match and the end ch is on the last, which might be incorrect depending on which clipping case you fall into. This was already somewhat buggy before your change, so it may not be an urgent issue... but just fyi. In case you feel like doing any more work on this code :-)
Also, might not hurt to add some clipping tests to FindInFiles-test at some point.
Member
There was a problem hiding this comment.
Sorry, that comment should be attached to the line.substr()/.substring() calls, not the end: initializer here...
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

For #9659 (at least part of it).

Best to explain with a before/after:
Before:
After:

So there are three ways text can clip: