Sublime Forum

Bug or feature? Adding words to selection with super+d

#1

Selecting a word with super+d and then continuing to press super+d until all words are selected works as expected.

But if the first word is selected by a double mouse click, then super+d will also add parts of words, which is very annoying. And in fact, being a double-clicker, this is the reason I’ve been avoiding this feature for years.

Is this the intended behavior?

0 Likes

How Does Selection Work On Sublime?
#2

there’s been no official response to the related GitHub issue, so hard to say whether intended or not - but I guess it’s useful for some people and they now are used to this workflow, which probably means it is now a feature, even if it may have originally been a bug…

0 Likes

#3

Feature (and a very nice one):

Build 2126
Release Date: 28 September 2011

  • Ctrl+D (Command+D on OS X) will search by whole words if the selection is initially empty
5 Likes

#4

Oh wow, thank you many times over. I wish I new this long ago, I’ve always selected the word and then got grumpy when Ctrl+D found partial matches.

3 Likes

#5

I want an option to change this behavior back to what it was. When I select something, I want to find next EXACT selection like that, not a partial match!

0 Likes

#6

:confused:
EXACT = whole word ?

0 Likes

#7

Not necessarily. I mean, sure, if I select only “i”, then I will want to Ctrl+D through just "i"s found on their own, not “i” from stuff like “visible” or whatever.

On the other hand, if I select something partial like “foo bar”, then I would want to Ctrl+D through all instances of just that.

Well I guess that’s what “whole word” is about, I guess. Even if it contains a word separator in the search term?

0 Likes

#8

I think that the current behavior is exactly what you want.

Put your cursor on “i” without selecting it (obviously “i” must be a single word, not a part of a word) and hit CTRL+D to select it and again to select the next “i” with whole word option.

Select “foo bar” and hit CTRL+D to select the next occurence without whole word option.

3 Likes

#9

OMG! I have been using Sublime Text for YEARS and did not know this!

Somehow I must have always selected the first instance with the mouse and was always annoyed by partial matches, especially for renaming short identifies like “i”, etc.

Please put this in the documentation (e. g. here), since this is a rather subtle difference!

Thank you

3 Likes

#10

OK - thank you! This is exactly what I’ve been looking for. A bit weird workflow for such a feature, but I think I can adapt. Cheers!

0 Likes