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

Highlight on select #41

Closed
kenijo opened this issue Aug 26, 2019 · 7 comments
Closed

Highlight on select #41

kenijo opened this issue Aug 26, 2019 · 7 comments

Comments

@kenijo
Copy link

kenijo commented Aug 26, 2019

Could you had the option to highlight on mouse select? And remove highlight when selection is unselected.

@ryu1kn
Copy link
Owner

ryu1kn commented Aug 27, 2019

Hi @kenijo , I’m not sure what you’re after. Isn’t that behaviour natively given by Code??

@kenijo
Copy link
Author

kenijo commented Aug 27, 2019

I believe the default behavior of VSCode is to highlight the current selection only when text is selected with the mouse.

My idea is to do the same as the right click > toggle highlight of your extension except when it would be triggered when selecting a word: highlight all the instances of that word in the current file/panel as well as in all other file/panel that are visible.

Is this really a default behavior? Maybe I am missing something as I cannot make it work as I described it.

@ryu1kn
Copy link
Owner

ryu1kn commented Aug 28, 2019

Ah... I see. Code highlights the same pattern (not regex pattern match) in just the current active file but not ALL files, and that's what you're after, isn't it?

Do you want to provide a bit more context? ⬇️Doesn't need to be long 😉

A couple of requests from me when you raise an github issue.

  • Requesting a feature: Please try to provide the context of why you want the feature. Such as, in what situation the feature could help you and how, or how the lack of the feature is causing an inconvenience to you. I can't think of introducing it until I understand how it helps you 🙂

@kenijo
Copy link
Author

kenijo commented Aug 28, 2019

Context for the feature:

Well it is very much the same context as using "toggle highlight" in the first place but with slightly more flexibility.

In my case, I often look at files side by side and I want to be able to "just" double click on the word in order to see all instances of that word highlighted in the current active panel but also in the inactive panels that are visible. I do not really need to have the word highlighted in all files (although ... maybe it could be nice...) Actually, if it is the current behavior of the "toggle highlight" then I would consider keeping it that way.

It is really helpful when going through code file or config files to identify commonalities. It is like a quick search across files feature. If the files are pretty big, you can easily navigate between the different instances of that word.

I am thinking highlight a variable name or keyword, not the word "the" that would appear 10000 times in book.

@ryu1kn
Copy link
Owner

ryu1kn commented Aug 28, 2019

Thanks @kenijo for the clarification 👍

Text Marker highlights patterns in all panels (both active & inactive) but not "files", I used that expression to make it intuitive, but it seems it just caused confusion, sorry 😛

I'm not sure how to trigger the toggle command by just double-clicking a word, but being able to toggle a highlight with a quicker action would be great. Thanks for the suggestion.

@ctf0 ctf0 mentioned this issue Dec 12, 2019
@lonix1
Copy link

lonix1 commented May 1, 2020

+1!

Until this feature is supported by vscode (if ever), it would be nice to have it in this extension.

i.e.: click to highlight word in all editors (of the same file).

@kenijo
Copy link
Author

kenijo commented Oct 10, 2024

As far as I understand, this now a VS Code feature under the option:

  • "editor.occurrencesHighlight": "off"
  • "editor.occurrencesHighlight": "singleFile"
  • "editor.occurrencesHighlight": "multiFile"

@kenijo kenijo closed this as completed Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants