Author Topic: Find In Files - always recursive  (Read 4361 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Find In Files - always recursive
« on: July 29, 2016, 05:18:05 PM »
If I do a FindInFiles with LookInSubFolders and LookInZip archives both checked, it does a recursive search as expected.


Now, repeat, but uncheck LookInSubFolders. It still does a recursive search, and the next time I open the find dialog LookInSubFolders is checked again.


I have to also uncheck LookInZip to avoid the recursive search.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Find In Files - always recursive
« Reply #1 on: July 31, 2016, 10:04:53 PM »
We could disable lookin subfolders when look in zip files is checked.  Doesn't really help much. The look in zip files has no effect unless you meant to do a recursive search. It treats zip files like directories to search in recursively.

I think you're confused as to what the look in zip files check box does.

If you want to look in one zip file non recursively, don't check look in subdirectories or look in zip files. Just specify path/file.zip/ for the path.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Find In Files - always recursive
« Reply #2 on: August 01, 2016, 04:30:58 AM »
Pretty sure that it is Slick that is confused.
FindInFiles.
SearchFor: #include
Lookin:C:\Program Files\SlickEdit Pro 21.0.0 Beta2
TYpes:*.e

[ ] LookInSubFolders is not checked.
  • Look in ZIP IS checked


FIND.

Slick recursively scans and finds results in *.e files.
Maybe in zip archives too - I dunno I don't care.


Open FindInFiles again.
[] LookInSubFolder is now CHECKED, even though it was NOT CHECKED when I last clicked FIND.


Seems to be a problem with the UI itself.
When the UI changes Zip from unchecked to checked, it also checks Subfolders.

« Last Edit: August 01, 2016, 01:41:29 PM by Clark »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Find In Files - always recursive
« Reply #3 on: August 01, 2016, 01:48:09 PM »
Maybe the UI should change Zip to unchecked if the user turns off subfolders. That might be less confusing.

The UI intentionally turns on subfolders if zip is checked. Otherwise, the zip setting is useless and wouldn't make any sense. Using the zip setting always means recursive (subfolders).

These could be radio buttons with 3 states (non-recursive, recursive, recursive and treat zips as dirs). This would take up way too much space and the wording would be confusing too thogh.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Find In Files - always recursive
« Reply #4 on: August 01, 2016, 06:05:26 PM »
The UI intentionally turns on subfolders if zip is checked.
Well, maybe it does internally, but it doesn't display it.

But this UI state (See the attached) does the wrong thing -- I asked for non-recursive, the UI shows non-recursive, and I still get recursive.

Whatever your opinion on zip archives, doing a plain folder recursive search when "look in subfolders" is unchecked, is a bug.


I'm not sure anyone would expect a non-recursive ZIP search ... though you could make the argument that it is reasonable to treat a ZIP archive the same as any directory.

Seems that 2 check boxes have 4 states and what I would have expected Slick to do:
0. NonRecursive, nonzip: Only files in the LookIn folders - search ZIP files as binary files.
1. NonRecursive, zip: Only files in the LookIn folders, including recursively inside Zip archives
2. Recursive, nonzip: LookIn Folders and children - search ZIP files as binary files.
3. Recursive, Zip: LookIn Folders and children, and inside Zip archives.

Does it ever make sense to search ZIP files as files and not as archives? (Oh, I wish Slick had a option in search "Do not search in binaries" - preferably based on the contents of the file rather than the extension alone. Imagine having that setting and it magically excludes ZIPs as files, object files, executables, dlls, *.gz, etc...)



Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Find In Files - always recursive
« Reply #5 on: August 01, 2016, 06:33:29 PM »
When both check boxes are unchecked, I'm always getting a non-recursive search. Is this not working for you?

We will see if we can uncheck zip files if the user turns off subfolders. That will be less confusing.

There are only 3 states. There's no state 1. To do what you want for state 1, do a non-recursive search (both check boxes off like state 0) and type in the zip file name with a trailing slash in the "look in" text box.

SlickEdit always supports treating zip files as directories if a path specified by the user has a has .zip/.jar/etc. filename. For example, from the SlickEdit command line "e c:\sdf\blah.zip\<file-name-in-zip>" will just work. There's no option to turn that off anywhere in SlickEdit.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Find In Files - always recursive
« Reply #6 on: August 01, 2016, 06:47:42 PM »

 :-[ I can't believe I did that ... lemme try again with a new screen shot showing what I've been trying to get at - where the UI shows non-recursive searching, and does recursive searching.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Find In Files - always recursive
« Reply #7 on: August 01, 2016, 08:08:09 PM »
We will see if we can uncheck zip files if the user turns off subfolders like you did in the picture. That will be less confusing.

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: Find In Files - always recursive
« Reply #8 on: August 01, 2016, 09:49:43 PM »
We will see if we can uncheck zip files if the user turns off subfolders like you did in the picture. That will be less confusing.

And presumably automatically enable the checkmark on subfolders if zip files gets checked?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Find In Files - always recursive
« Reply #9 on: August 01, 2016, 10:01:33 PM »
Yes