From de932e66b5bd07e7c597321863a1292a8d9ad823 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 18 Jan 2025 22:34:01 +0800 Subject: [PATCH] .. --- yazi-core/src/manager/commands/hover.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/yazi-core/src/manager/commands/hover.rs b/yazi-core/src/manager/commands/hover.rs index b909ec1d..c620779b 100644 --- a/yazi-core/src/manager/commands/hover.rs +++ b/yazi-core/src/manager/commands/hover.rs @@ -1,4 +1,4 @@ -use std::{collections::HashSet, path::PathBuf}; +use std::collections::HashSet; use yazi_dds::Pubsub; use yazi_macro::render; @@ -50,16 +50,8 @@ impl Manager { } fn hover_do(&mut self, url: Url, tab: Option) { - // Hover on the file - if let Ok(p) = url.strip_prefix(&self.current_or(tab).url).map(PathBuf::from) { - render!(self.current_or_mut(tab).repos(Some(Urn::new(&p)))); - } - - // Turn on tracing - if self.current_or(tab).hovered().is_some_and(|h| h.url == url) { - // `hover(Some)` occurs after user actions, such as create, rename, reveal, etc. - // At this point, it's intuitive to track the location of this file regardless. - self.current_or_mut(tab).trace = Some(url.urn_owned()); + if let Ok(p) = url.strip_prefix(&self.current_or(tab).url) { + render!(self.current_or_mut(tab).hover(Urn::new(p))); } } }