mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
d022983830
commit
de932e66b5
1 changed files with 3 additions and 11 deletions
|
|
@ -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<Id>) {
|
||||
// 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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue