microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.13k stars 29.27k forks source link

Add option to display Selection Highlights across Split Editor panes #154529

Open joshg253 opened 2 years ago

joshg253 commented 2 years ago

(Unable to figure out how to do this, nor find existing issues that match so I'm adding a feature request for it.)

Request: extend the Selection Highlight feature so it can be used across the same file in Split Editor. The feature should be toggleable.

Currently: if you place a cursor on or select a word (red underline in screenshot) it lights up the same word elsewhere in the document and shows all their locations on the scrollbar (circled in red in screenshot).

image

This request would (optionally) also light up the same words and show their locations in the other pane/scrollbar (green marks in screenshot). I'm thinking specifically for the same document in multiple panes, but perhaps there are use cases for this across different documents.

OS is irrelevant: I use vscode on Win10, Win11, and various Linux distros (I [also] use Arch!), and would like the feature available in all.

Idea trigger / usage example: I was editing a very long .ini file that had a bunch of duplicate keys (but not necessary values) in it, and was utilizing the Selection Highlight in the scrollbar feature extensively, then tried to also utilize the Split Editor view, which helped a bit but would have been even more useful if this feature existed.

vscodenpa commented 2 years ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

hediet commented 2 years ago

I think this could be very easy to implement. Afaik by just setting "owner" of the occurence decoration to undefined.

pbahnl commented 1 year ago

Would be really nice to have! :)

Chaitran77 commented 1 year ago

Any progress on this? It's July 2023 and don't think this functionality exists...

transistorgrab commented 1 year ago

I have the same issue like OP that I have multiple positions where a string appears in a long document and hoped this feature would work across multiple views of the same file.

@Chaitran77 sadly the initial 60 days upvote timeframe seems elapsed. No idea how to bring this to the developers attention.

I'm not familiar with vscode's programming. Would be great if someone could come up with a solution and post a PR on this feature…

mooserson commented 1 year ago

Likewise, in comparing some similar files this would be invaluable; bump

danztran commented 11 months ago

Got enough upvotes now, really nice to have this!! can we keep it going? 🚀

mooserson commented 3 months ago

Let's make it happen heroes 🙏

Chaitran77 commented 3 months ago

Perhaps we open a new issue and the body is just a reference to this one? The initial comment has a decent write-up so we should just use that...

Inetov commented 2 months ago

It looks like it's already implemented! Try enabling the setting: "editor.occurrencesHighlight": "multiFile"

"Editor: Occurrences Highlight" supports the following values: