Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

assistant2: Exclude deleted files from stale list (#27821)

Agus Zubiagac7298428042b
diff --git a/crates/assistant_tool/src/action_log.rs b/crates/assistant_tool/src/action_log.rs
index 2842aeddf21..099378464d8 100644
--- a/crates/assistant_tool/src/action_log.rs
+++ b/crates/assistant_tool/src/action_log.rs
@@ -402,7 +402,14 @@ impl ActionLog {
pub fn stale_buffers<'a>(&'a self, cx: &'a App) -> impl Iterator<Item = &'a Entity<Buffer>> {
self.tracked_buffers
.iter()
- .filter(|(buffer, tracked)| tracked.version != buffer.read(cx).version)
+ .filter(|(buffer, tracked)| {
+ let buffer = buffer.read(cx);
+
+ tracked.version != buffer.version
+ && buffer
+ .file()
+ .map_or(false, |file| file.disk_state() != DiskState::Deleted)
+ })
.map(|(buffer, _)| buffer)
}