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); self.arrow(0);
if self.files.is_empty() {
self.tracing = false;
}
self.files.revision != revision self.files.revision != revision
} }

View file

@ -84,13 +84,19 @@ impl Tab {
apply(&mut self.current); 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 self
.current .current
.hovered() .hovered()
.filter(|h| h.is_dir()) .filter(|h| h.is_dir())
.and_then(|h| self.history.get_mut(&h.url)) .and_then(|h| self.history.get_mut(&h.url))
.map(apply); .map(apply);
self.parent.as_mut().map(apply);
} }
} }