Browse Source

Make "Find in Files" searches ignore directories with `.gdignore` files in them

This pull request fixes an issue where searches using the "Find in Files" function would include folders with `.gdignore` files in them. The editor is supposed to ignore directories with these files in them altogether.

(cherry picked from commit 658b152bd8f546dfb0fe54d4dce49d9e5f87ce8c)
Nicholas Huelin 4 years ago
parent
commit
61d153a1fa
1 changed files with 5 additions and 0 deletions
  1. 5 0
      editor/find_in_files.cpp

+ 5 - 0
editor/find_in_files.cpp

@@ -233,6 +233,11 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
 			break;
 		}
 
+		// If there is a .gdignore file in the directory, don't bother searching it
+		if (file == ".gdignore") {
+			break;
+		}
+
 		// Ignore special dirs (such as .git and .import)
 		if (file == "." || file == ".." || file.begins_with(".")) {
 			continue;