Add editor option to allow selection highlighting of multiline selections and another option to control max length #228982
+55
−10
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.
Currently, multiline highlights (of selection matches) aren't possible. Multiline is explicitly disabled with a claim of performance but in my initial testing everything seems fine. What does it matter if a selection is 10 chars and happens to have a newline in it versus not? Especially considering the fact that you can search for a multiline string without any problems, so why would this be any different?
Furthermore, the max length of a highlight was hard coded to 200 chars. I added another option for that. Including the option to not limit the length.
I will do further analysis of these changes to see if anything else is impacted. So far it works great!
FYI this has been previously discussed #10588 with no resolution and a closed ticket.
Default values
I set the new defaults to mirror current behavior that:
But, I believe we could increase the max length. Perhaps someone could run performance tests to see if there are any issues with 1000s to 10000s of characters.
Alternative approach
Understandings
Example