Sublime Forum

Ctrl+d (find_under_expand) doesn't select matching selection

#1

Consider the following lines of PHP code:

\App\Logger::warn('test_warn');
\App\Logger::warn('test_warn');
\App\Logger::warn('test_warn');

When I place my cursor in the “warn” of the first ::warn( and press ctrl+d (find_under_expand), the word “warn” is selected. When I press ctrl+d again, what I would expect is the “warn” in the ‘test_warn’ to be selected. However, what happens is that the warn in the next ::warn( is selected. However however, when I use my mouse to select the first ::warn( and press ctrl+d, the “warn” in the ‘test_warn’ is selected. Is this supposed to work like this?

0 Likes

#2

most likely - find_under_expand will find the next instance of the word under the caret when there is no selection - because underscore is not set as a word separator, test_warn isn’t considered to match the word warn. With a selection, it no longer checks word boundaries when finding matches.

0 Likes

#3

Good to know! I was expecting that after the first word being selected, it would use that selection to find the next occurence, but this clears that up :). Thanks!

0 Likes