Home Download Buy Blog Forum Support

Find in selection behavior

Find in selection behavior

Postby hubert on Sat Apr 28, 2012 1:32 pm

I find that (in the latest nightly build, but I also experienced it earlier) the "in selection" button of the find panel sometimes behaves oddly. I managed to make this reproducible:

1. Open a new file.
2. Enter "test"
2. Open the Find panel (cmd+f, "in selection" button is deselected).
3. Search for "e" -> highlights the letter e
2. Select the whole word "test" and activate the "in selection" button (or press cmd+f, this will activate the button, too (correctly))
4. hit find again-> "unable to find "e" in selection"

Overall I would highly appreciate it if there were some visual indication what the "current selection" refers to. When you select a region, press cmd+f to find something in the region, each match will be highlighted as a selection (which is absolutely fine) but then the indication of the area that is being searched is gone.

This is sometimes especially weird when you just have been searching something within a selection and now want to search something different, and--by mistake--have the "in selection" box still activated, there is no visual clue that the text is only found in a certain region.

Any thoughts by other people?
hubert
 
Posts: 31
Joined: Mon Jan 09, 2012 12:12 pm

Re: Find in selection behavior

Postby hubert on Mon Apr 30, 2012 9:59 am

I can't quite believe that nobody ever encounters these sort of problems?
hubert
 
Posts: 31
Joined: Mon Jan 09, 2012 12:12 pm

Re: Find in selection behavior

Postby vitaLee on Sun Jun 03, 2012 9:04 pm

"find in selection" confuses me too.
when my selection spans across multiple lines and i hit cmd+f, find in selection options is activated.
i expect this to be true for single line selection, but it's not.
i find this is incosisten bahaviour.
if i have selection before initiating find i'd expect that option to be turned on.
is this by design?
is there a way to add keyboard shortcut to toggle 'find in selection', and some of the other find options as well?
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: Find in selection behavior

Postby patku on Mon Jun 18, 2012 6:21 pm

Like @hubert, I expected the behavior of 'find in selection' to automatically respond to whatever the selection is (or becomes while the find/replace toolbar is open). I imagine that the reason it requires one to make the selection and then Ctrl+F to 'reset' what the 'selection' is has to do with the problem of selecting found items. I've noticed in other editors that they will select found text and then change what 'selection' means to be just the text they selected for you (rather than the larger subset of selected text you started with). One way to get around this problem would be to have the user select text and then trigger an action (e.g. Ctrl+F) in order to 'set' what the 'selection' is. This appears to be what the developer of Sublime has done.

There are a few usability issues with this choice. For one, it seems like 'find in selection' is broken when the user makes a new selection and Sublime can't find anything within it. To fix this, the 'selection' would have to dynamically change while the find/replace toolbar is open (but only by the user; changing the selection by finding a term would be bad).

The second problem with the current setup is that Ctrl+H (for find/replace) does *not* trigger a reset of the 'selection'. Right now, one has to do a Ctrl+F and then a Ctrl+H to reset the selection in order to do find/replace.
patku
 
Posts: 3
Joined: Mon Jun 18, 2012 3:10 pm

Re: Find in selection behavior

Postby CNG on Fri Jan 10, 2014 11:56 pm

I'm also frustrated by what seems to be exactly what @hubert describes, using the latest ST3 beta (build 3059 stable channel)
CNG
 
Posts: 2
Joined: Fri Jan 10, 2014 11:55 pm

Re: Find in selection behavior

Postby rmmoul on Tue Feb 25, 2014 5:44 pm

I'm on build 3059 (linux, on ubuntu 12.04), and have had to do the replace in selection action twice every time I've wanted to do a search/replace in a selection of text.

My process:

- ctrl+h (bring up search and replace dialog, and if anything is selected it gets deselected..)
- type the text to find, and the text to replace it with
- click the "in selection" button
- select my text
- click "replace all"

Nothing gets replaced, even though there are text matches in the selection. So Then I repeat the process:

-ctrl+h (my text selection is deselected, but my search and replace texts are still there)
click the "in selection" button again
select the text again
click "replace all" again

The second time it works..
rmmoul
 
Posts: 10
Joined: Thu Jan 23, 2014 1:45 am

Re: Find in selection behavior

Postby s7dhansh on Fri Feb 28, 2014 11:11 am

This setting should help you.

Code: Select all
"auto_find_in_selection": false
s7dhansh
 
Posts: 1
Joined: Fri Feb 28, 2014 11:08 am

Re: Find in selection behavior

Postby Fluss on Sat Oct 25, 2014 10:01 pm

Thank you very much, s7dhansh. That worked fine. :)
Fluss
 
Posts: 1
Joined: Sat Oct 25, 2014 9:59 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests