From 760d7cb23192c91c00fa03a8be3b2c355d6168d1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 30 Apr 2024 01:01:28 +0200 Subject: [PATCH] Increase threshold for files per directory in editor Find in Files This allows up to 100,000 files per folder to be searched with Find in Files, as opposed to just 1,000. --- editor/find_in_files.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 3bddc91b81a2..dff7ee5bb8b6 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -222,7 +222,9 @@ void FindInFiles::_scan_dir(const String &path, PackedStringArray &out_folders, dir->list_dir_begin(); - for (int i = 0; i < 1000; ++i) { + // Limit to 100,000 iterations to avoid an infinite loop just in case + // (this technically limits results to 100,000 files per folder). + for (int i = 0; i < 100'000; ++i) { String file = dir->get_next(); if (file.is_empty()) {