diff options
Diffstat (limited to 'crates/vfs-notify/src/lib.rs')
-rw-r--r-- | crates/vfs-notify/src/lib.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index 5b4978285..a2f4e0c5b 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs | |||
@@ -89,8 +89,8 @@ impl LoaderActor { | |||
89 | match event { | 89 | match event { |
90 | Event::Message(msg) => match msg { | 90 | Event::Message(msg) => match msg { |
91 | Message::Config(config) => { | 91 | Message::Config(config) => { |
92 | let n_entries_total = config.load.len(); | 92 | let n_total = config.load.len(); |
93 | self.send(loader::Message::Progress { n_entries_total, n_entries_done: 0 }); | 93 | self.send(loader::Message::Progress { n_total, n_done: 0 }); |
94 | 94 | ||
95 | self.unwatch_all(); | 95 | self.unwatch_all(); |
96 | self.config.clear(); | 96 | self.config.clear(); |
@@ -99,10 +99,7 @@ impl LoaderActor { | |||
99 | let watch = config.watch.contains(&i); | 99 | let watch = config.watch.contains(&i); |
100 | let files = self.load_entry(entry, watch); | 100 | let files = self.load_entry(entry, watch); |
101 | self.send(loader::Message::Loaded { files }); | 101 | self.send(loader::Message::Loaded { files }); |
102 | self.send(loader::Message::Progress { | 102 | self.send(loader::Message::Progress { n_total, n_done: i + 1 }); |
103 | n_entries_total, | ||
104 | n_entries_done: i + 1, | ||
105 | }); | ||
106 | } | 103 | } |
107 | self.config.sort_by(|x, y| x.0.cmp(&y.0)); | 104 | self.config.sort_by(|x, y| x.0.cmp(&y.0)); |
108 | } | 105 | } |
@@ -199,7 +196,7 @@ impl LoaderActor { | |||
199 | let is_dir = entry.file_type().is_dir(); | 196 | let is_dir = entry.file_type().is_dir(); |
200 | let is_file = entry.file_type().is_file(); | 197 | let is_file = entry.file_type().is_file(); |
201 | let abs_path = AbsPathBuf::try_from(entry.into_path()).unwrap(); | 198 | let abs_path = AbsPathBuf::try_from(entry.into_path()).unwrap(); |
202 | if is_dir { | 199 | if is_dir && watch { |
203 | self.watch(abs_path.clone()); | 200 | self.watch(abs_path.clone()); |
204 | } | 201 | } |
205 | let rel_path = abs_path.strip_prefix(&path)?; | 202 | let rel_path = abs_path.strip_prefix(&path)?; |