Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ctrl+D should match whole words instead of substrings #8869
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
@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:
referenced this issue
Dec 21, 2016
changed the title from
Highlight whole words of the word under cursor instead of substrings
Ctrl+D should match whole words instead of substrings
Apr 11, 2017
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