From b7297993890567b4ecc1aacd04c51ba8ddc31fc4 Mon Sep 17 00:00:00 2001 From: amrelnaggar Date: Mon, 17 Aug 2015 15:43:32 +0200 Subject: [PATCH 1/2] Fix: Find in Files results don't update to reflect external changes unless file is open --- src/search/FindInFiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 121f39c8b32..c2acec965d4 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -795,7 +795,7 @@ define(function (require, exports, module) { var addPromise; if (entry.isDirectory) { - if (!added || !removed) { + if (!added || !removed || (!added.length && !removed.length)) { // If the added or removed sets are null, must redo the search for the entire subtree - we // don't know which child files/folders may have been added or removed. _removeSearchResultsForEntry(entry); From 30bbf5febda7a0e6683f8cba9f81bce891863fb3 Mon Sep 17 00:00:00 2001 From: Amr El-Naggar Date: Sat, 27 Aug 2016 01:40:51 +0200 Subject: [PATCH 2/2] Use strict equal of length of added and removed sets against zero Addresses code review comments --- src/search/FindInFiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index c2acec965d4..edbd7b61fa2 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -795,7 +795,7 @@ define(function (require, exports, module) { var addPromise; if (entry.isDirectory) { - if (!added || !removed || (!added.length && !removed.length)) { + if (!added || !removed || (added.length === 0 && removed.length === 0)) { // If the added or removed sets are null, must redo the search for the entire subtree - we // don't know which child files/folders may have been added or removed. _removeSearchResultsForEntry(entry);