Skip to content
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

Add editor option to allow selection highlighting of multiline selections and another option to control max length #228982

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

g0t4
Copy link

@g0t4 g0t4 commented Sep 18, 2024

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:

  • disables multiline
  • limits to 200 characters.

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

  • Another approach would be to lift the restriction on multiline and get rid of the new option. Just always allow it
  • Perhaps even allow unlimited length unless some tests can show its a problem?

Understandings

  • FYI minimap doesn't highlight similar matches of a selection. It only highlights actual selection(s), find matches and one word matches. So, no changes for this.
  • FYI, when using multiple cursors, after adding a second cursor any highlights from the first cursor+selection disappear. So, no changes either.

Example

image

@g0t4
Copy link
Author

g0t4 commented Sep 18, 2024

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants