From a9ce71457114d9fee31b0cc6c4779d37a5f92e51 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 26 Jan 2024 13:18:15 +0800 Subject: [PATCH] fix: parent folder not tracking CWD (#581) --- yazi-core/src/folder/folder.rs | 4 ---- yazi-core/src/tab/tab.rs | 10 ++++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/yazi-core/src/folder/folder.rs b/yazi-core/src/folder/folder.rs index bbf36441..6d5b714e 100644 --- a/yazi-core/src/folder/folder.rs +++ b/yazi-core/src/folder/folder.rs @@ -49,10 +49,6 @@ impl Folder { } self.arrow(0); - if self.files.is_empty() { - self.tracing = false; - } - self.files.revision != revision } diff --git a/yazi-core/src/tab/tab.rs b/yazi-core/src/tab/tab.rs index 272c9b6e..c431c404 100644 --- a/yazi-core/src/tab/tab.rs +++ b/yazi-core/src/tab/tab.rs @@ -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); } }