Sublime Forum

Question regarding find in files with a where pattern

#1

I wanted to exclude a folder from searching using the find in files command:

-the-folder/*

which worked for the the-folder at the root level of my project. But then as it turns out it also excludes some-other-path/the-folder if it happens to have the same folder name.

Am I missing something, I definitely do not expect to have nested folders excluded in case this is supposed to be a path.

0 Likes

#2

See the documentation on File Patterns for more information, but in short this is indeed expected behaviour for that particular pattern. To have it affect only the version in the root of the package, prefix the pattern with //, such as -//the-folder/* (though this requires ST4).

0 Likes

#3

Thanks, that was the documentation I was searching for. However that doesn’t seems to work either. You can try it yourself on ST4. Nothing is mentioned about the case when you want to exclude the pattern with a - so that might be a bug?

EDIT:

The above mentioned pattern to specify a relative path works inside binary_file_patterns for example, but it doesn’t work if I enter the exact same pattern inside the Where text area inside the Find in Files panel:

-//folder1/*,-//folder2/*,-//folder3/*
0 Likes