From 2efb2a7de0ded7ec5c55f57324827949c8b7494b Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 7 Mar 2017 17:49:32 +0000 Subject: [PATCH] do not start watcher on grandchildren --- plugins/c9.ide.tree/tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/c9.ide.tree/tree.js b/plugins/c9.ide.tree/tree.js index 7220e7e9..8a1a4b6e 100644 --- a/plugins/c9.ide.tree/tree.js +++ b/plugins/c9.ide.tree/tree.js @@ -414,7 +414,7 @@ define(function(require, exports, module) { // watch children var substr = id[id.length - 1] !== "/" ? id + "/" : id; Object.keys(expandedList).forEach(function(path) { - if (path.lastIndexOf(substr, 0) === 0) { + if (path.startsWith(substr) && path.indexOf("/", substr.length) == -1) { watcher.watch(path, refresh); } });