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

CMD+D should be smarter #9978

Closed
normalser opened this issue Jul 30, 2016 · 9 comments
Closed

CMD+D should be smarter #9978

normalser opened this issue Jul 30, 2016 · 9 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-multicursor Editor multiple cursor issues feature-request Request for new features or functionality
Milestone

Comments

@normalser
Copy link

  • VSCode Version: 1.4.0-insiders
  • OS Version: OSX

Steps to Reproduce:

  1. Create file with:
test
TEST
Test
aTesTer
test-123
test234
test
  1. Put cursor at position 1:1 and press CMD+D 7 times
  2. VS Code selects:

image

It should only select next matches using case sensitivity and whole words

Here is Atom result for the same:

image

@spywhere
Copy link
Contributor

FYI, Sublime Text utilise the settings from Find panel in order to match these words.

@kieferrm kieferrm added editor-find Editor find operations feature-request Request for new features or functionality editor labels Aug 2, 2016
@alexdima
Copy link
Member

alexdima commented Aug 2, 2016

@wallverb cmd+d respects the find widget settings which can be toggled via keyboard (match whole word, case sensitivty)

@alexdima alexdima removed the feature-request Request for new features or functionality label Aug 2, 2016
@alexdima alexdima added this to the Backlog milestone Aug 2, 2016
@atombender
Copy link

I recommend that VSCode adopt the behaviour that Atom has, and which I believe Sublime also has: If you don't start with a selection, then whole-word matching is implicit.

For example: If I have the cursor at the beginning of the word "foo", then cmd-D will only match whole-word instances of "foo". If I select "foo", then cmd-D will match any substring.

This is extremely convenient as a shorthand.

FWIW, I personally find the feature where cmd-D respects the Find panel's case/whole-word settings to be quite exhausting. The setting I need is usually different every time I need to use cmd-D. I continually have to hit cmd-alt-c, cmd-alt-w in order to toggle these (and I rely on cmd-D a lot). My above suggestion will reduce the necessary keypresses to just one key, which would help greatly.

@ShimShamSam
Copy link

ShimShamSam commented Jan 31, 2017

This behavior is the only thing keeping me from switching to VS Code. It's unfortunate when I decide to rename a variable like "i" and it starts selecting random i's in the middle of other words. It ruins the refactor use-case of multiple cursors.

@atombender
Copy link

Indeed. Replying to myself to make another important point:

The setting I need is usually different every time I need to use cmd-D.

...and it's exacerbated by the fact that you don't know what the case/word toggles are set to unless you hit cmd-F. Almost every time I use the cmd-D feature, not only are the toggles wrong, but I have to do a cmd-F just to see what the toggles are set to.

@ShimShamSam
Copy link

The new version (1.9) semi-addresses the problem by making the toggle states visible when using Ctrl+D, but I don't see why these states are shared with the search functionality at this point. Doing this has probably added more complexity when compared to Sublime's behavior as described by @atombender

@jameslieu
Copy link

jameslieu commented Apr 7, 2017

Isn't this already addressed?

Press CMD + f
You'll need to toggle Match case and Match whole words option:

image

Then it'll work as expected:
image

I'm pretty sure that sublime also behaves this way

@atombender
Copy link

@jameslieu: No, Sublime does not work that way. Read my explanation. Sublime always uses whole-word matching unless you explicitly make a selection before hitting cmd-D. It's a superior workflow and reduces the need for a whole-word toggle for cmd-D.

@alexandrudima: Looks to me like this issue is being ignored. Any way we can move it forward?

@alexdima alexdima added the editor-multicursor Editor multiple cursor issues label Apr 11, 2017
@alexdima alexdima added the feature-request Request for new features or functionality label Apr 21, 2017
@alexdima
Copy link
Member

I believe this is resolved with PR #36682 (for #8869) . When starting with a collapsed selection, Command+D will now search with wholeWords: true and caseSensitive: true.

@alexdima alexdima added *duplicate Issue identified as a duplicate of another issue(s) and removed editor-find Editor find operations labels Oct 23, 2017
@alexdima alexdima modified the milestones: Backlog, October 2017 Oct 23, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-multicursor Editor multiple cursor issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

7 participants