mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
a1197b5c83
commit
83d00ac307
6 changed files with 10 additions and 20 deletions
|
|
@ -41,9 +41,9 @@ impl<'de> Deserialize<'de> for Opener {
|
||||||
#[serde(rename = "for")]
|
#[serde(rename = "for")]
|
||||||
for_: Option<String>,
|
for_: Option<String>,
|
||||||
|
|
||||||
// TODO: remove this when v1.0.5 is released --
|
// TODO: remove this when v0.1.6 is released --
|
||||||
display_name: Option<String>,
|
display_name: Option<String>,
|
||||||
// TODO: -- remove this when v1.0.5 is released
|
// TODO: -- remove this when v0.1.6 is released
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut shadow = Shadow::deserialize(deserializer)?;
|
let mut shadow = Shadow::deserialize(deserializer)?;
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,6 @@ impl Help {
|
||||||
|
|
||||||
self.offset = 0;
|
self.offset = 0;
|
||||||
self.cursor = 0;
|
self.cursor = 0;
|
||||||
|
|
||||||
// TODO: Peek
|
|
||||||
// emit!(Peek); // Show/hide preview for images
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ impl Manager {
|
||||||
if let Ok(f) = File::from(child.clone()).await {
|
if let Ok(f) = File::from(child.clone()).await {
|
||||||
emit!(Files(FilesOp::Creating(cwd, f.into_map())));
|
emit!(Files(FilesOp::Creating(cwd, f.into_map())));
|
||||||
Manager::_hover(Some(child));
|
Manager::_hover(Some(child));
|
||||||
Manager::_refresh();
|
|
||||||
}
|
}
|
||||||
Ok::<(), anyhow::Error>(())
|
Ok::<(), anyhow::Error>(())
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ impl From<()> for Opt {
|
||||||
impl Tasks {
|
impl Tasks {
|
||||||
pub fn toggle(&mut self, _: impl Into<Opt>) -> bool {
|
pub fn toggle(&mut self, _: impl Into<Opt>) -> bool {
|
||||||
self.visible = !self.visible;
|
self.visible = !self.visible;
|
||||||
// TODO: Peek
|
|
||||||
// emit!(Peek); // Show/hide preview for images
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ impl Which {
|
||||||
self.times = 1;
|
self.times = 1;
|
||||||
self.cands =
|
self.cands =
|
||||||
KEYMAP.get(layer).iter().filter(|s| s.on.len() > 1 && &s.on[0] == key).cloned().collect();
|
KEYMAP.get(layer).iter().filter(|s| s.on.len() > 1 && &s.on[0] == key).cloned().collect();
|
||||||
self.switch(true);
|
self.visible = true;
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,23 +35,16 @@ impl Which {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if self.cands.is_empty() {
|
if self.cands.is_empty() {
|
||||||
self.switch(false);
|
self.visible = false;
|
||||||
} else if self.cands.len() == 1 {
|
} else if self.cands.len() == 1 {
|
||||||
self.switch(false);
|
self.visible = false;
|
||||||
emit!(Call(self.cands[0].to_call(), self.layer));
|
emit!(Call(self.cands[0].to_call(), self.layer));
|
||||||
} else if let Some(i) = self.cands.iter().position(|c| c.on.len() == self.times + 1) {
|
} else if let Some(i) = self.cands.iter().position(|c| c.on.len() == self.times + 1) {
|
||||||
self.switch(false);
|
self.visible = false;
|
||||||
emit!(Call(self.cands[i].to_call(), self.layer));
|
emit!(Call(self.cands[i].to_call(), self.layer));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.times += 1;
|
self.times += 1;
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn switch(&mut self, state: bool) {
|
|
||||||
self.visible = state;
|
|
||||||
// TODO: Peek
|
|
||||||
// emit!(Peek); // Show/hide preview for images
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,10 @@ impl App {
|
||||||
yazi_plugin::scope(&self.cx, |_| {
|
yazi_plugin::scope(&self.cx, |_| {
|
||||||
f.render_widget(Root::new(&self.cx), f.size());
|
f.render_widget(Root::new(&self.cx), f.size());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if let Some((x, y)) = self.cx.cursor() {
|
||||||
|
f.set_cursor(x, y);
|
||||||
|
}
|
||||||
})?;
|
})?;
|
||||||
if !COLLISION.load(Ordering::Relaxed) {
|
if !COLLISION.load(Ordering::Relaxed) {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|
@ -106,7 +110,6 @@ impl App {
|
||||||
term.show_cursor()?;
|
term.show_cursor()?;
|
||||||
term.set_cursor(x, y)?;
|
term.set_cursor(x, y)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
term.backend_mut().flush()?;
|
term.backend_mut().flush()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue