ActiveState Community

find selected text

Posted by mhahnca on 2007-05-02 12:13

Please don't tell me the only way to search for selected text is to use the drop-down menu in the find box! I do almost all my searching by selecting. The standard is to use the selected text if there is a selection and not if not.

At least give me a setting to remove this abomination.

This would be a show-stopper for me. It is extremely painful.

trentm | Wed, 2007-05-02 14:03

This was a change in 4.1.0-beta2 as per this bug:

http://bugs.activestate.com/show_bug.cgi?id=68431
put *last* search term in Find dialog field; put word under cursor in
autocomplete list

The argument for having the *last* searched for term as the default goes like this:
- you want to search for "blah"
- your currently tab is "foo.php"
- you open the Find dialog and search for "blah"
- then you realize "blah" is from "bar.php", so you switch to that tab and hit:
Ctrl+F # to open the Find dialog
Enter # to search for the next occurrence of "blah"

Before the change in behaviour, in the last step you'd have ended up searching for whatever word the cursor ended up being on after switching to the "bar.php" tab.

In mine and others' experience that wasn't ideal -- hence the change. Since switching the behaviour, I admit to occasionally *also* wanting the old way. So it comes down to which one is least surprising for typical usage -- or if there is a good way to support both. Note that, yes, we can provide a pref to be able to select your preferred behaviour, but it is important to nail down what the default should be.

I won't mind some thoughts from others on this (with no promises that everyone will be happy with what is actually done). :)

For comparison Visual Studio.NET works the "old" way (i.e. the default search term is the selection/word-under-cursor).

mhahnca | Wed, 2007-05-02 14:07

Every single tool I use works "the old way".

You have either got to go back or else give me a preference. I don't care what the default is.

trentm | Wed, 2007-05-02 14:15

mhahnca,

Agreed. I was just talking it through with the co-worker who originally proposed the behaviour change. We tried to figure out what the appropriate answer was to the scenario I described as the original impetus. Instead of changing the Find dialog behaviour, my response should have been: just use "Find Next". :)

/me scuttles back into the code

mhahnca | Wed, 2007-05-02 14:18

I should have thought of that. I do that all the time.

There is a moral in here somewhere. Something to the effect that one should count to 10 before changing the UI. :-)

ericp | Thu, 2007-05-03 09:50

* Select some text

* Press the shift-control-I option (on Windows and Linux).

This moves to the next occurrence of the text,
and F3 will repeat moving forward (shift-F3 backwards).