-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Ctrl+D should match whole words instead of substrings #8869
Comments
Wow I didn't expect Find box to be related to the cursor highlighting words. Shouldn't these be two separate settings? I'd like to highlight whole words but search for substrings. For example when I'm searching for something I may not necessarily know the entire word that I'm searching for so I type in a substring, but for highlighting words under cursor, the entire word is known. |
I agree that it is possible to wish to search for a substring and then wish to highlight only a full-word selection both at the same time, but I think this is quite uncommon and inventing separate UI affordances for "whole word" find and "whole word" selection highlight and "whole word" I personally use @xiaochuanyu Do you have other ideas around this that would make for a better user experience? |
@alexandrudima , what do you think about the following scheme?
This is similar to scheme in Sublime Text except that Sublime Text doesn't actually highlight substrings when you select some text but will allow you to select them via multi-cursor (ctrl-D). Sublime Text only highlights whole words. |
cc @joaomoreno as the initial author of HSUC. @xiaochuanyu I am open to disconnecting the HSUC feature from HSUC is not impacting anything actually, it just adds visual decorators to the text. I made the leap of thinking those visual decorators would work great with I am sorry the screen capture tool does not capture keypresses. But I'm using:
Maybe it's just me using HSUC as a preview of |
Having disliked it once introduced, I grew fonder of the currently implemented behaviour. |
@alexandrudima , I understand your reasoning here to use HSUC as a preview for The main point for the scheme I described above is that it saves me from manually toggling the setting to use (whole word or substring) when I do Another point I'd like to make is that I use whole word in Find very rarely relative to using whole word in The bad thing about this scheme is that you can't do case sensitive Would be interesting if some statistics can be collected about what settings Find and I quote my comment above for reference:
|
I am also anxiously hoping the selection highlight and find settings are separated. |
I'd like to join the chorus with @xiaochuanyu: I'm using Ctrl+D and HSUC exclusively case sensitive and whole word, as opposed to Find, which is mostly case insensitive and partial word. I came here by googling for that exact feature. |
I came from Sublime and these are the default behaviors, case sensitive and whole word. |
I came from Visual Studio (and a couple of great extensions) and would love to see all instances of the currently selected word highlighted in the scrollbar without having to use |
Definitely want to see the sublime behavior implemented. It is indispensable when working in HTML. |
The same is also being used by atom I hope it gets resolved quickly |
👍 |
I'm just going to voice up and say that I love having substring matching (that is what I use in Atom and ST - can't remember if I configured it or not). |
I have to agree with all of the above that cmd-D/ctrl-D is not "Find". Atom and Sublime's behaviour is inuitive and requires fewer keystrokes — and VSCode doesn't offer a good story to justify deviating from that behaviour. |
Any updates on this? |
Can we close this and create a new issue to disconnect editor selections and HSUC from find selections? I believe this will solve all problems. In other words ALT+C/+W in editor won't affect find's setting. This way everyone will be able to set selections and HSUC vs find to their preferences and be happy once again. |
@tino2kp: That's related to some very idiosyncratic choices in various VSCode grammars. For example, in Ruby, |
I will look into making the following changes to Ctrl+D and the selection highlights. The selection highlights will continue to match 100% what Ctrl+D will do; they will remain a reliable preview of what Ctrl+D will select next. Here is the mechanism: Ctrl+D temporary overwriting of the find widget toggles
Finally, @tino2kp , Ctrl+D today honors the word definition that comes in via language configuration (as @atombender pointed out). Let's discuss if Ctrl+D should better use |
@alexandrudima This is fantastic, and exactly what I was wishing for. Thank you for your efforts! |
@alexandrudima Pardon my ignorance.. but what do you mean by "collapsed selection"? I can't see any visual difference in the first two animated GIFs above. How does one make Cmd+D override the 'Find' settings? |
@ffxsam A collapsed selection is just a technical way of saying "no selection". Technically, it's a selection where the start and end are the same position. |
Got it! Thanks, and thanks to the VS Code team for this awesome update! |
Wow I've been annoyed by this for so long, really glad to see it fixed! |
Is there a way to highlight matching whole words of the word under cursor instead of all substrings?
In VScode, the current behaviour:
What I want (as seen in Sublime):
This is actually the default behaviour in Sublime Text and IntelliJ based IDEs.
The text was updated successfully, but these errors were encountered: