Skip to content

Conversation

g0t4
Copy link
Contributor

@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
Contributor Author

g0t4 commented Sep 18, 2024

@microsoft-github-policy-service agree

Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you and apologies for the slow turn-around time!

@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 14, 2025
@alexdima alexdima enabled auto-merge (squash) July 14, 2025 21:35
@alexdima alexdima merged commit 034724a into microsoft:main Jul 14, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants