From f84de497187aed1fd014962394ef17dd49138322 Mon Sep 17 00:00:00 2001 From: Nicholas Huelin <62965063+SirQuartz@users.noreply.github.com> Date: Fri, 30 Jul 2021 15:10:05 -0400 Subject: [PATCH] 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) --- editor/find_in_files.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 73a4e0163e9..333da9a3f47 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -235,6 +235,11 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) { if (file == "") 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;