Sublime Forum

Bug: Multiple "Where:" filter does not work!

#1

When searching a project, the Where: field allows following:

folder/, otherFolder/

But if I want only Sass files, I would write:
folder/, otherFolder/, *.scss

But this does not work. Only folders or file extensions, not both.
If it’s a bug, please fix because this is crucial!

0 Likes

#3

Well, it does not work here. This is the concrete example and it also finds .js and .js.map, …

Am I doing something wrong?

0 Likes

#4

I am using version Build 3125 on Mac, El Capitan.

0 Likes

#5

The where field doesn’t work the way you think it does. Any term that doesn’t start with a - is an inclusion, adding to the list of things to search. If you’re familiar with the terminology, this represents a boolean combination of or, not of and.

In effect, the where string that you’re using is telling sublime to search for files containing the word main:

  1. In the folder craft/templates/ (any file found inside)
  2. In the folder public/foundation/ (any file found inside)
  3. In the folder craft/plugins/ (any file found inside)
  4. Inside files whose names match *.scss (in any folder in your project)

Based on your original question about wanting only Sass files, the where path you need is:

craft/templates/*.scss, public/foundation/*.scss, craft/plugins/*.scss

This tells sublime “search only inside of scss files inside each of these three directories”.

Depending on the content of the folders in question, you could also use exclusions in the where field. As an example, if the folders that you are searching only contains scss, js and js.map files, you could use a where of:

craft/templates, public/foundation/, craft/plugins, -*.js, -*.js.map

Which tells sublime "Look for the text in all of the files in these three folders except for files of type js and js.map. This can get to be a bit of a bear if there are a lot of file types, though.

4 Likes

#6

Thanks! I feel stupid now :slightly_smiling:

0 Likes

#7

Ahh not at all. I think we’ve all been bitten by Find in Files a time or two. :slightly_smiling:

0 Likes

#8

Nice explanation @OdatNurd! You should consider submitting it as a PR to the unofficial docs, as it isn’t explained nearly as well there at the moment, in my opinion :wink:

0 Likes