From 45b41465e1559893d20844069de3eafe02d2d6d3 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 11 May 2021 16:54:01 +0200 Subject: [PATCH] Don't consider scan as being complete until its state is Idle Co-Authored-By: Nathan Sobo --- zed/src/worktree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zed/src/worktree.rs b/zed/src/worktree.rs index aa0d99e3901672a1acdc0e2bad24fdad8242aa37..1478daaff3ab11ae7614bff97ef570c5fe47c38c 100644 --- a/zed/src/worktree.rs +++ b/zed/src/worktree.rs @@ -118,8 +118,8 @@ impl Worktree { let scan_id = self.snapshot.scan_id; ctx.spawn_stream( self.scan_state.1.clone(), - move |this, _, ctx| { - if this.snapshot.scan_id > scan_id { + move |this, scan_state, ctx| { + if matches!(scan_state, ScanState::Idle) && this.snapshot.scan_id > scan_id { ctx.halt_stream(); } },