yazi/yazi-core/src/tasks/commands/toggle.rs
2024-10-11 18:05:08 +08:00

26 lines
410 B
Rust

use yazi_shared::{event::Cmd, render};
use crate::tasks::Tasks;
pub struct Opt;
impl From<Cmd> for Opt {
fn from(_: Cmd) -> Self { Self }
}
impl From<()> for Opt {
fn from(_: ()) -> Self { Self }
}
impl Tasks {
#[yazi_codegen::command]
pub fn toggle(&mut self, _: Opt) {
self.visible = !self.visible;
if self.visible {
self.summaries = self.paginate();
self.arrow(0);
}
render!();
}
}