mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
24 lines
533 B
Rust
24 lines
533 B
Rust
use anyhow::Result;
|
|
use yazi_core::mgr::Yanked;
|
|
use yazi_macro::{render, succ};
|
|
use yazi_parser::mgr::UpdateYankedOpt;
|
|
use yazi_shared::event::Data;
|
|
|
|
use crate::{Actor, Ctx};
|
|
|
|
pub struct UpdateYanked;
|
|
|
|
impl Actor for UpdateYanked {
|
|
type Options = UpdateYankedOpt<'static>;
|
|
|
|
const NAME: &str = "update_yanked";
|
|
|
|
fn act(cx: &mut Ctx, opt: Self::Options) -> Result<Data> {
|
|
if opt.urls.is_empty() && cx.mgr.yanked.is_empty() {
|
|
succ!();
|
|
}
|
|
|
|
cx.mgr.yanked = Yanked::new(opt.cut, opt.urls.into_owned());
|
|
succ!(render!());
|
|
}
|
|
}
|