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

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-04-01 00:26:29 -03:00 committed by GitHub
parent 715e23a491
commit c729842804
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}