yazi/yazi-core/src/spot/commands/swipe.rs
XOR-op 0d9e3dc17e
feat!: support arrow prev and arrow next for more components (#2540)
Co-authored-by: sxyazi <sxyazi@gmail.com>
2025-03-27 23:59:59 +08:00

22 lines
414 B
Rust

use std::borrow::Cow;
use yazi_proxy::{MgrProxy, TabProxy};
use yazi_shared::event::CmdCow;
use crate::spot::Spot;
struct Opt {
step: Cow<'static, str>,
}
impl From<CmdCow> for Opt {
fn from(mut c: CmdCow) -> Self { Self { step: c.take_first_str().unwrap_or_default() } }
}
impl Spot {
#[yazi_codegen::command]
pub fn swipe(&mut self, opt: Opt) {
TabProxy::arrow(opt.step);
MgrProxy::spot(None);
}
}