mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
de932e66b5
commit
d5f4cd7c2e
5 changed files with 10 additions and 6 deletions
|
|
@ -26,7 +26,7 @@ impl Manager {
|
|||
if let Some(u) = opt.url {
|
||||
self.hover_do(u, opt.tab);
|
||||
} else {
|
||||
self.current_or_mut(opt.tab).repos(None);
|
||||
self.current_or_mut(opt.tab).arrow(0);
|
||||
}
|
||||
|
||||
// Repeek
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ impl Tab {
|
|||
return;
|
||||
}
|
||||
|
||||
self.current.repos(hovered.as_ref().map(|u| u.as_urn()));
|
||||
self.current.repos(hovered.as_ref());
|
||||
if self.hovered().map(|f| f.urn()) != hovered.as_ref().map(|u| u.as_urn()) {
|
||||
ManagerProxy::hover(None, self.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ impl Folder {
|
|||
}
|
||||
|
||||
self.trace = self.trace.take_if(|_| !self.files.is_empty() || self.stage.is_loading());
|
||||
self.repos(self.trace.clone().as_ref().map(|u| u.as_urn()));
|
||||
self.repos(self.trace.clone());
|
||||
|
||||
(stage, revision) != (self.stage, self.files.revision)
|
||||
}
|
||||
|
|
@ -116,8 +116,8 @@ impl Folder {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn repos(&mut self, url: Option<&Urn>) -> bool {
|
||||
if let Some(u) = url { self.hover(u) } else { self.arrow(0) }
|
||||
pub fn repos(&mut self, url: Option<impl AsRef<Urn>>) -> bool {
|
||||
if let Some(u) = url { self.hover(u.as_ref()) } else { self.arrow(0) }
|
||||
}
|
||||
|
||||
pub fn sync_page(&mut self, force: bool) {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ impl Tab {
|
|||
f.files.set_sorter(<_>::from(&self.pref));
|
||||
|
||||
render!(f.files.catchup_revision());
|
||||
render!(f.repos(f.trace.clone().as_ref().map(|u| u.as_urn())));
|
||||
render!(f.repos(f.trace.clone()));
|
||||
};
|
||||
|
||||
apply(&mut self.current);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ impl Borrow<Urn> for UrnBuf {
|
|||
fn borrow(&self) -> &Urn { Urn::new(&self.0) }
|
||||
}
|
||||
|
||||
impl AsRef<Urn> for UrnBuf {
|
||||
fn as_ref(&self) -> &Urn { self.borrow() }
|
||||
}
|
||||
|
||||
impl AsRef<Path> for UrnBuf {
|
||||
fn as_ref(&self) -> &Path { &self.0 }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue