From c41f2e21e039c068d4ae1d286f2a8a9eef182895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Fri, 31 Jan 2025 17:02:02 +0800 Subject: [PATCH] fix: squeeze the parent directory offset after terminal size change (#2275) --- yazi-core/src/manager/manager.rs | 3 +++ yazi-fm/src/app/commands/resize.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/yazi-core/src/manager/manager.rs b/yazi-core/src/manager/manager.rs index 51c44eb0..da5b7179 100644 --- a/yazi-core/src/manager/manager.rs +++ b/yazi-core/src/manager/manager.rs @@ -70,6 +70,9 @@ impl Manager { #[inline] pub fn parent(&self) -> Option<&Folder> { self.active().parent.as_ref() } + #[inline] + pub fn parent_mut(&mut self) -> Option<&mut Folder> { self.active_mut().parent.as_mut() } + #[inline] pub fn hovered(&self) -> Option<&File> { self.active().hovered() } diff --git a/yazi-fm/src/app/commands/resize.rs b/yazi-fm/src/app/commands/resize.rs index e55930d8..cb96e81d 100644 --- a/yazi-fm/src/app/commands/resize.rs +++ b/yazi-fm/src/app/commands/resize.rs @@ -20,5 +20,6 @@ impl App { self.cx.current_mut().sync_page(true); self.cx.manager.hover(None); + self.cx.manager.parent_mut().map(|f| f.arrow(0)); } }