fix: parent folder not tracking CWD (#581)

This commit is contained in:
sxyazi 2024-01-26 13:18:15 +08:00
parent ba0c860b2e
commit a9ce714571
No known key found for this signature in database
2 changed files with 8 additions and 6 deletions

View file

@ -49,10 +49,6 @@ impl Folder {
}
self.arrow(0);
if self.files.is_empty() {
self.tracing = false;
}
self.files.revision != revision
}

View file

@ -84,13 +84,19 @@ impl Tab {
apply(&mut self.current);
if let Some(parent) = &mut self.parent {
apply(parent);
// The parent should always track the CWD
parent.hover(&self.current.cwd);
parent.tracing = parent.hovered().map(|h| &h.url) == Some(&self.current.cwd);
}
self
.current
.hovered()
.filter(|h| h.is_dir())
.and_then(|h| self.history.get_mut(&h.url))
.map(apply);
self.parent.as_mut().map(apply);
}
}