From 20227bdb1394da973eb7d9e057485ca38088d285 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Tue, 31 Mar 2026 21:53:29 +0800 Subject: [PATCH] .. --- yazi-actor/src/actor.rs | 6 +++--- yazi-actor/src/app/accept_payload.rs | 2 +- yazi-actor/src/app/bootstrap.rs | 4 ++-- yazi-actor/src/app/deprecate.rs | 4 ++-- yazi-actor/src/app/focus.rs | 4 ++-- yazi-actor/src/app/lua.rs | 4 ++-- yazi-actor/src/app/mouse.rs | 4 ++-- yazi-actor/src/app/plugin.rs | 4 ++-- yazi-actor/src/app/plugin_do.rs | 4 ++-- yazi-actor/src/app/quit.rs | 4 ++-- yazi-actor/src/app/reflow.rs | 4 ++-- yazi-actor/src/app/resize.rs | 4 ++-- yazi-actor/src/app/resume.rs | 4 ++-- yazi-actor/src/app/stop.rs | 4 ++-- yazi-actor/src/app/title.rs | 6 +++--- yazi-actor/src/app/update_progress.rs | 4 ++-- yazi-actor/src/cmp/arrow.rs | 4 ++-- yazi-actor/src/cmp/close.rs | 4 ++-- yazi-actor/src/cmp/show.rs | 4 ++-- yazi-actor/src/cmp/trigger.rs | 4 ++-- yazi-actor/src/confirm/arrow.rs | 4 ++-- yazi-actor/src/confirm/close.rs | 4 ++-- yazi-actor/src/confirm/show.rs | 4 ++-- yazi-actor/src/help/arrow.rs | 4 ++-- yazi-actor/src/help/escape.rs | 4 ++-- yazi-actor/src/help/filter.rs | 4 ++-- yazi-actor/src/help/toggle.rs | 4 ++-- yazi-actor/src/input/close.rs | 4 ++-- yazi-actor/src/input/complete.rs | 4 ++-- yazi-actor/src/input/escape.rs | 4 ++-- yazi-actor/src/input/show.rs | 4 ++-- yazi-actor/src/mgr/arrow.rs | 4 ++-- yazi-actor/src/mgr/back.rs | 4 ++-- yazi-actor/src/mgr/bulk_exit.rs | 4 ++-- yazi-actor/src/mgr/bulk_rename.rs | 4 ++-- yazi-actor/src/mgr/cd.rs | 4 ++-- yazi-actor/src/mgr/close.rs | 4 ++-- yazi-actor/src/mgr/copy.rs | 4 ++-- yazi-actor/src/mgr/create.rs | 4 ++-- yazi-actor/src/mgr/displace.rs | 4 ++-- yazi-actor/src/mgr/displace_do.rs | 4 ++-- yazi-actor/src/mgr/download.rs | 4 ++-- yazi-actor/src/mgr/enter.rs | 4 ++-- yazi-actor/src/mgr/escape.rs | 24 +++++++++++------------ yazi-actor/src/mgr/filter.rs | 4 ++-- yazi-actor/src/mgr/filter_do.rs | 4 ++-- yazi-actor/src/mgr/find.rs | 4 ++-- yazi-actor/src/mgr/find_arrow.rs | 4 ++-- yazi-actor/src/mgr/find_do.rs | 4 ++-- yazi-actor/src/mgr/follow.rs | 4 ++-- yazi-actor/src/mgr/forward.rs | 4 ++-- yazi-actor/src/mgr/hardlink.rs | 4 ++-- yazi-actor/src/mgr/hidden.rs | 6 +++--- yazi-actor/src/mgr/hover.rs | 4 ++-- yazi-actor/src/mgr/leave.rs | 4 ++-- yazi-actor/src/mgr/linemode.rs | 4 ++-- yazi-actor/src/mgr/link.rs | 4 ++-- yazi-actor/src/mgr/open.rs | 4 ++-- yazi-actor/src/mgr/open_do.rs | 4 ++-- yazi-actor/src/mgr/paste.rs | 4 ++-- yazi-actor/src/mgr/peek.rs | 4 ++-- yazi-actor/src/mgr/quit.rs | 6 +++--- yazi-actor/src/mgr/refresh.rs | 4 ++-- yazi-actor/src/mgr/remove.rs | 8 ++++---- yazi-actor/src/mgr/rename.rs | 4 ++-- yazi-actor/src/mgr/reveal.rs | 4 ++-- yazi-actor/src/mgr/search.rs | 12 ++++++------ yazi-actor/src/mgr/seek.rs | 4 ++-- yazi-actor/src/mgr/shell.rs | 4 ++-- yazi-actor/src/mgr/sort.rs | 6 +++--- yazi-actor/src/mgr/spot.rs | 4 ++-- yazi-actor/src/mgr/stash.rs | 6 +++--- yazi-actor/src/mgr/suspend.rs | 4 ++-- yazi-actor/src/mgr/tab_close.rs | 4 ++-- yazi-actor/src/mgr/tab_create.rs | 4 ++-- yazi-actor/src/mgr/tab_rename.rs | 4 ++-- yazi-actor/src/mgr/tab_swap.rs | 4 ++-- yazi-actor/src/mgr/tab_switch.rs | 4 ++-- yazi-actor/src/mgr/toggle.rs | 4 ++-- yazi-actor/src/mgr/toggle_all.rs | 4 ++-- yazi-actor/src/mgr/unyank.rs | 4 ++-- yazi-actor/src/mgr/update_files.rs | 4 ++-- yazi-actor/src/mgr/update_mimes.rs | 4 ++-- yazi-actor/src/mgr/update_paged.rs | 4 ++-- yazi-actor/src/mgr/update_peeked.rs | 4 ++-- yazi-actor/src/mgr/update_spotted.rs | 4 ++-- yazi-actor/src/mgr/update_yanked.rs | 4 ++-- yazi-actor/src/mgr/upload.rs | 4 ++-- yazi-actor/src/mgr/visual_mode.rs | 4 ++-- yazi-actor/src/mgr/watch.rs | 4 ++-- yazi-actor/src/mgr/yank.rs | 4 ++-- yazi-actor/src/notify/push.rs | 6 +++--- yazi-actor/src/notify/tick.rs | 4 ++-- yazi-actor/src/pick/arrow.rs | 4 ++-- yazi-actor/src/pick/close.rs | 4 ++-- yazi-actor/src/pick/show.rs | 4 ++-- yazi-actor/src/spot/arrow.rs | 4 ++-- yazi-actor/src/spot/close.rs | 4 ++-- yazi-actor/src/spot/copy.rs | 4 ++-- yazi-actor/src/spot/swipe.rs | 4 ++-- yazi-actor/src/tasks/arrow.rs | 4 ++-- yazi-actor/src/tasks/cancel.rs | 4 ++-- yazi-actor/src/tasks/close.rs | 4 ++-- yazi-actor/src/tasks/inspect.rs | 4 ++-- yazi-actor/src/tasks/open_shell_compat.rs | 4 ++-- yazi-actor/src/tasks/process_open.rs | 4 ++-- yazi-actor/src/tasks/show.rs | 4 ++-- yazi-actor/src/tasks/update_succeed.rs | 4 ++-- yazi-actor/src/which/activate.rs | 6 +++--- yazi-actor/src/which/dismiss.rs | 4 ++-- yazi-macro/src/actor.rs | 4 ++-- 111 files changed, 245 insertions(+), 245 deletions(-) diff --git a/yazi-actor/src/actor.rs b/yazi-actor/src/actor.rs index a09cbfd9..71e474c6 100644 --- a/yazi-actor/src/actor.rs +++ b/yazi-actor/src/actor.rs @@ -5,11 +5,11 @@ use yazi_shared::data::Data; use crate::Ctx; pub trait Actor { - type Options; + type Form; const NAME: &str; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result; + fn act(cx: &mut Ctx, form: Self::Form) -> Result; - fn hook(_cx: &Ctx, _opt: &Self::Options) -> Option { None } + fn hook(_cx: &Ctx, _form: &Self::Form) -> Option { None } } diff --git a/yazi-actor/src/app/accept_payload.rs b/yazi-actor/src/app/accept_payload.rs index 1efe777c..e9de9bed 100644 --- a/yazi-actor/src/app/accept_payload.rs +++ b/yazi-actor/src/app/accept_payload.rs @@ -13,7 +13,7 @@ use crate::{Actor, Ctx}; pub struct AcceptPayload; impl Actor for AcceptPayload { - type Options = Payload<'static>; + type Form = Payload<'static>; const NAME: &str = "accept_payload"; diff --git a/yazi-actor/src/app/bootstrap.rs b/yazi-actor/src/app/bootstrap.rs index 1f1e8339..312476d0 100644 --- a/yazi-actor/src/app/bootstrap.rs +++ b/yazi-actor/src/app/bootstrap.rs @@ -10,11 +10,11 @@ use crate::Actor; pub struct Bootstrap; impl Actor for Bootstrap { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "bootstrap"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { cx.mgr.tabs.resize_with(BOOT.files.len(), Default::default); for (i, file) in BOOT.files.iter().enumerate().rev() { diff --git a/yazi-actor/src/app/deprecate.rs b/yazi-actor/src/app/deprecate.rs index b4f52bb7..afac183e 100644 --- a/yazi-actor/src/app/deprecate.rs +++ b/yazi-actor/src/app/deprecate.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Deprecate; impl Actor for Deprecate { - type Options = DeprecateForm; + type Form = DeprecateForm; const NAME: &str = "deprecate"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(notify:push, cx, MessageOpt { title: "Deprecated API".to_owned(), content: opt.content.into_owned(), diff --git a/yazi-actor/src/app/focus.rs b/yazi-actor/src/app/focus.rs index 9f9c614d..1d2def54 100644 --- a/yazi-actor/src/app/focus.rs +++ b/yazi-actor/src/app/focus.rs @@ -9,9 +9,9 @@ use crate::Actor; pub struct Focus; impl Actor for Focus { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "focus"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { act!(mgr:refresh, cx) } + fn act(cx: &mut Ctx, _: Self::Form) -> Result { act!(mgr:refresh, cx) } } diff --git a/yazi-actor/src/app/lua.rs b/yazi-actor/src/app/lua.rs index d8340c71..4543fcf6 100644 --- a/yazi-actor/src/app/lua.rs +++ b/yazi-actor/src/app/lua.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx, lives::Lives}; pub struct Lua; impl Actor for Lua { - type Options = LuaForm; + type Form = LuaForm; const NAME: &str = "lua"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let chunk = LUA.load(&*opt.code).set_name("anonymous"); let result = Lives::scope(cx.core, || { runtime_scope!(LUA, "inline", Sendable::value_to_data(&LUA, chunk.eval()?)) diff --git a/yazi-actor/src/app/mouse.rs b/yazi-actor/src/app/mouse.rs index f28a5471..8f1a92ae 100644 --- a/yazi-actor/src/app/mouse.rs +++ b/yazi-actor/src/app/mouse.rs @@ -15,11 +15,11 @@ use crate::{Actor, Ctx}; pub struct Mouse; impl Actor for Mouse { - type Options = MouseForm; + type Form = MouseForm; const NAME: &str = "mouse"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let event = yazi_binding::MouseEvent::from(opt.event); let Some(size) = cx.term.as_ref().and_then(|t| t.size().ok()) else { succ!() }; diff --git a/yazi-actor/src/app/plugin.rs b/yazi-actor/src/app/plugin.rs index c3437dc4..9518800d 100644 --- a/yazi-actor/src/app/plugin.rs +++ b/yazi-actor/src/app/plugin.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx}; pub struct Plugin; impl Actor for Plugin { - type Options = PluginForm; + type Form = PluginForm; const NAME: &str = "plugin"; - fn act(cx: &mut Ctx, Self::Options { mut opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { mut opt }: Self::Form) -> Result { let mut hits = false; if let Some(chunk) = LOADER.read().get(&*opt.id) { hits = true; diff --git a/yazi-actor/src/app/plugin_do.rs b/yazi-actor/src/app/plugin_do.rs index 204d7590..b16ba31c 100644 --- a/yazi-actor/src/app/plugin_do.rs +++ b/yazi-actor/src/app/plugin_do.rs @@ -16,11 +16,11 @@ use crate::{Actor, Ctx, lives::Lives}; pub struct PluginDo; impl Actor for PluginDo { - type Options = PluginForm; + type Form = PluginForm; const NAME: &str = "plugin_do"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { let loader = LOADER.read(); let Some(chunk) = loader.get(&*opt.id) else { succ!(warn!("plugin `{}` not found", opt.id)); diff --git a/yazi-actor/src/app/quit.rs b/yazi-actor/src/app/quit.rs index db14a7ba..c00d6343 100644 --- a/yazi-actor/src/app/quit.rs +++ b/yazi-actor/src/app/quit.rs @@ -10,11 +10,11 @@ use crate::{Actor, Ctx}; pub struct Quit; impl Actor for Quit { - type Options = QuitForm; + type Form = QuitForm; const NAME: &str = "quit"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { cx.tasks.shutdown(); cx.mgr.shutdown(); diff --git a/yazi-actor/src/app/reflow.rs b/yazi-actor/src/app/reflow.rs index 21d3cae3..df496856 100644 --- a/yazi-actor/src/app/reflow.rs +++ b/yazi-actor/src/app/reflow.rs @@ -13,11 +13,11 @@ use crate::{Actor, Ctx}; pub struct Reflow; impl Actor for Reflow { - type Options = ReflowForm; + type Form = ReflowForm; const NAME: &str = "reflow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let Some(size) = cx.term.as_ref().and_then(|t| t.size().ok()) else { succ!() }; let mut layout = LAYOUT.get(); diff --git a/yazi-actor/src/app/resize.rs b/yazi-actor/src/app/resize.rs index ce93b503..037f62ab 100644 --- a/yazi-actor/src/app/resize.rs +++ b/yazi-actor/src/app/resize.rs @@ -9,11 +9,11 @@ use crate::Actor; pub struct Resize; impl Actor for Resize { - type Options = ReflowForm; + type Form = ReflowForm; const NAME: &str = "resize"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(app:reflow, cx, opt)?; cx.current_mut().arrow(0); diff --git a/yazi-actor/src/app/resume.rs b/yazi-actor/src/app/resume.rs index 12514914..502eaaf7 100644 --- a/yazi-actor/src/app/resume.rs +++ b/yazi-actor/src/app/resume.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Resume; impl Actor for Resume { - type Options = ResumeForm; + type Form = ResumeForm; const NAME: &str = "resume"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { cx.active_mut().preview.reset(); *cx.term = Some(Term::start()?); diff --git a/yazi-actor/src/app/stop.rs b/yazi-actor/src/app/stop.rs index 11b10d10..69e1af0e 100644 --- a/yazi-actor/src/app/stop.rs +++ b/yazi-actor/src/app/stop.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Stop; impl Actor for Stop { - type Options = StopForm; + type Form = StopForm; const NAME: &str = "stop"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { cx.active_mut().preview.reset_image(); // We need to destroy the `term` first before stopping the `signals` diff --git a/yazi-actor/src/app/title.rs b/yazi-actor/src/app/title.rs index 76bade4a..6b5587b5 100644 --- a/yazi-actor/src/app/title.rs +++ b/yazi-actor/src/app/title.rs @@ -12,11 +12,11 @@ use crate::Actor; pub struct Title; impl Actor for Title { - type Options = TitleForm; + type Form = TitleForm; const NAME: &str = "title"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let s = opt.value.unwrap_or_else(|| format!("Yazi: {}", cx.tab().name()).into()); execute!(TTY.writer(), SetTitle(&s))?; @@ -24,7 +24,7 @@ impl Actor for Title { succ!() } - fn hook(cx: &Ctx, _opt: &Self::Options) -> Option { + fn hook(cx: &Ctx, _opt: &Self::Form) -> Option { match cx.source() { Source::Ind => Some(SparkKind::IndAppTitle), _ => None, diff --git a/yazi-actor/src/app/update_progress.rs b/yazi-actor/src/app/update_progress.rs index a0f6d99e..7d4d4b05 100644 --- a/yazi-actor/src/app/update_progress.rs +++ b/yazi-actor/src/app/update_progress.rs @@ -9,11 +9,11 @@ use crate::Actor; pub struct UpdateProgress; impl Actor for UpdateProgress { - type Options = UpdateProgressForm; + type Form = UpdateProgressForm; const NAME: &str = "update_progress"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { // Update the progress of all tasks. let tasks = &mut cx.tasks; let progressed = tasks.summary != opt.summary; diff --git a/yazi-actor/src/cmp/arrow.rs b/yazi-actor/src/cmp/arrow.rs index aa0176d5..5f0d4139 100644 --- a/yazi-actor/src/cmp/arrow.rs +++ b/yazi-actor/src/cmp/arrow.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Arrow; impl Actor for Arrow { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { succ!(render!(cx.cmp.scroll(opt.step))); } } diff --git a/yazi-actor/src/cmp/close.rs b/yazi-actor/src/cmp/close.rs index 24e34529..633a95d6 100644 --- a/yazi-actor/src/cmp/close.rs +++ b/yazi-actor/src/cmp/close.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx}; pub struct Close; impl Actor for Close { - type Options = CloseForm; + type Form = CloseForm; const NAME: &str = "close"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let cmp = &mut cx.cmp; if let Some(item) = cmp.selected().filter(|_| opt.submit).cloned() { return act!(input:complete, cx, CompleteOpt { name: item.name, is_dir: item.is_dir, ticket: cmp.ticket }); diff --git a/yazi-actor/src/cmp/show.rs b/yazi-actor/src/cmp/show.rs index b6671e39..a29c98db 100644 --- a/yazi-actor/src/cmp/show.rs +++ b/yazi-actor/src/cmp/show.rs @@ -13,11 +13,11 @@ const LIMIT: usize = 30; pub struct Show; impl Actor for Show { - type Options = ShowForm; + type Form = ShowForm; const NAME: &str = "show"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { let cmp = &mut cx.cmp; if cmp.ticket != opt.ticket { succ!(); diff --git a/yazi-actor/src/cmp/trigger.rs b/yazi-actor/src/cmp/trigger.rs index 46cfe2b9..5f32022d 100644 --- a/yazi-actor/src/cmp/trigger.rs +++ b/yazi-actor/src/cmp/trigger.rs @@ -14,11 +14,11 @@ use crate::{Actor, Ctx}; pub struct Trigger; impl Actor for Trigger { - type Options = TriggerForm; + type Form = TriggerForm; const NAME: &str = "trigger"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { if opt.ticket.is_some_and(|t| t != cx.cmp.ticket) { succ!(); } else if opt.ticket.is_none() { diff --git a/yazi-actor/src/confirm/arrow.rs b/yazi-actor/src/confirm/arrow.rs index 527cf109..a892dd51 100644 --- a/yazi-actor/src/confirm/arrow.rs +++ b/yazi-actor/src/confirm/arrow.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Arrow; impl Actor for Arrow { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let confirm = &mut cx.core.confirm; let area = cx.core.mgr.area(confirm.position); diff --git a/yazi-actor/src/confirm/close.rs b/yazi-actor/src/confirm/close.rs index 75663241..fa3001d8 100644 --- a/yazi-actor/src/confirm/close.rs +++ b/yazi-actor/src/confirm/close.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Close; impl Actor for Close { - type Options = CloseForm; + type Form = CloseForm; const NAME: &str = "close"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { cx.confirm.token.complete(opt.submit); cx.confirm.visible = false; succ!(render!()); diff --git a/yazi-actor/src/confirm/show.rs b/yazi-actor/src/confirm/show.rs index a9def0ad..800d4625 100644 --- a/yazi-actor/src/confirm/show.rs +++ b/yazi-actor/src/confirm/show.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Show; impl Actor for Show { - type Options = ShowForm; + type Form = ShowForm; const NAME: &str = "show"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(confirm:close, cx)?; let confirm = &mut cx.confirm; diff --git a/yazi-actor/src/help/arrow.rs b/yazi-actor/src/help/arrow.rs index 68c156b6..3f58c03d 100644 --- a/yazi-actor/src/help/arrow.rs +++ b/yazi-actor/src/help/arrow.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Arrow; impl Actor for Arrow { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { succ!(render!(cx.help.scroll(opt.step))); } } diff --git a/yazi-actor/src/help/escape.rs b/yazi-actor/src/help/escape.rs index b26c1035..3e26003c 100644 --- a/yazi-actor/src/help/escape.rs +++ b/yazi-actor/src/help/escape.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Escape; impl Actor for Escape { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "escape"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { if cx.help.keyword().is_none() { return act!(help:toggle, cx, cx.help.layer); } diff --git a/yazi-actor/src/help/filter.rs b/yazi-actor/src/help/filter.rs index 37174075..94cab689 100644 --- a/yazi-actor/src/help/filter.rs +++ b/yazi-actor/src/help/filter.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Filter; impl Actor for Filter { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "filter"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let help = &mut cx.help; help.in_filter = Some(Default::default()); diff --git a/yazi-actor/src/help/toggle.rs b/yazi-actor/src/help/toggle.rs index f94e8a8b..c3abf422 100644 --- a/yazi-actor/src/help/toggle.rs +++ b/yazi-actor/src/help/toggle.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Toggle; impl Actor for Toggle { - type Options = ToggleForm; + type Form = ToggleForm; const NAME: &str = "toggle"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let help = &mut cx.help; help.visible = !help.visible; diff --git a/yazi-actor/src/input/close.rs b/yazi-actor/src/input/close.rs index cb2b7f64..5077cfc2 100644 --- a/yazi-actor/src/input/close.rs +++ b/yazi-actor/src/input/close.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Close; impl Actor for Close { - type Options = CloseForm; + type Form = CloseForm; const NAME: &str = "close"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let input = &mut cx.input; input.visible = false; input.ticket.next(); diff --git a/yazi-actor/src/input/complete.rs b/yazi-actor/src/input/complete.rs index c0120e9b..faa9e341 100644 --- a/yazi-actor/src/input/complete.rs +++ b/yazi-actor/src/input/complete.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Complete; impl Actor for Complete { - type Options = CompleteOpt; + type Form = CompleteOpt; const NAME: &str = "complete"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let input = &mut cx.input; if !input.visible || input.ticket.current() != opt.ticket { succ!(); diff --git a/yazi-actor/src/input/escape.rs b/yazi-actor/src/input/escape.rs index 4533b6fb..495e0528 100644 --- a/yazi-actor/src/input/escape.rs +++ b/yazi-actor/src/input/escape.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Escape; impl Actor for Escape { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "escape"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { use yazi_widgets::input::InputMode as M; let input = &mut cx.input; diff --git a/yazi-actor/src/input/show.rs b/yazi-actor/src/input/show.rs index cab85543..beec471e 100644 --- a/yazi-actor/src/input/show.rs +++ b/yazi-actor/src/input/show.rs @@ -10,11 +10,11 @@ use crate::{Actor, Ctx}; pub struct Show; impl Actor for Show { - type Options = InputOpt; + type Form = InputOpt; const NAME: &str = "show"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(input:close, cx)?; let input = &mut cx.input; diff --git a/yazi-actor/src/mgr/arrow.rs b/yazi-actor/src/mgr/arrow.rs index ca9f661c..be7ba2c7 100644 --- a/yazi-actor/src/mgr/arrow.rs +++ b/yazi-actor/src/mgr/arrow.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Arrow; impl Actor for Arrow { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tab = cx.tab_mut(); if !tab.current.arrow(opt.step) { succ!(); diff --git a/yazi-actor/src/mgr/back.rs b/yazi-actor/src/mgr/back.rs index cedaaf92..1f604819 100644 --- a/yazi-actor/src/mgr/back.rs +++ b/yazi-actor/src/mgr/back.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Back; impl Actor for Back { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "back"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { if let Some(u) = cx.tab_mut().backstack.shift_backward().cloned() { act!(mgr:cd, cx, (u, CdSource::Back))?; } diff --git a/yazi-actor/src/mgr/bulk_exit.rs b/yazi-actor/src/mgr/bulk_exit.rs index 0f300971..84dc5dc6 100644 --- a/yazi-actor/src/mgr/bulk_exit.rs +++ b/yazi-actor/src/mgr/bulk_exit.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct BulkExit; impl Actor for BulkExit { - type Options = BulkExitForm; + type Form = BulkExitForm; const NAME: &str = "bulk_exit"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { cx.mgr.batcher.decide(opt.target, opt.accept); succ!(); } diff --git a/yazi-actor/src/mgr/bulk_rename.rs b/yazi-actor/src/mgr/bulk_rename.rs index 4c58816c..7443980d 100644 --- a/yazi-actor/src/mgr/bulk_rename.rs +++ b/yazi-actor/src/mgr/bulk_rename.rs @@ -24,11 +24,11 @@ use crate::{Actor, Ctx}; pub struct BulkRename; impl Actor for BulkRename { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "bulk_rename"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let Some(opener) = Self::opener() else { succ!(NotifyProxy::push_warn("Bulk rename", "No text opener found")); }; diff --git a/yazi-actor/src/mgr/cd.rs b/yazi-actor/src/mgr/cd.rs index 2edd42ed..41e82528 100644 --- a/yazi-actor/src/mgr/cd.rs +++ b/yazi-actor/src/mgr/cd.rs @@ -18,11 +18,11 @@ use crate::{Actor, Ctx}; pub struct Cd; impl Actor for Cd { - type Options = CdForm; + type Form = CdForm; const NAME: &str = "cd"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(mgr:escape_visual, cx)?; if opt.interactive { return Self::cd_interactive(cx); diff --git a/yazi-actor/src/mgr/close.rs b/yazi-actor/src/mgr/close.rs index debe3aa7..44cbc490 100644 --- a/yazi-actor/src/mgr/close.rs +++ b/yazi-actor/src/mgr/close.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Close; impl Actor for Close { - type Options = CloseForm; + type Form = CloseForm; const NAME: &str = "close"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { if cx.tabs().len() > 1 { act!(mgr:tab_close, cx, cx.tabs().cursor) } else { diff --git a/yazi-actor/src/mgr/copy.rs b/yazi-actor/src/mgr/copy.rs index 28b496df..8d3527f4 100644 --- a/yazi-actor/src/mgr/copy.rs +++ b/yazi-actor/src/mgr/copy.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Copy; impl Actor for Copy { - type Options = CopyForm; + type Form = CopyForm; const NAME: &str = "copy"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(mgr:escape_visual, cx)?; let mut s = Vec::::new(); diff --git a/yazi-actor/src/mgr/create.rs b/yazi-actor/src/mgr/create.rs index c17c7c6a..58654c5e 100644 --- a/yazi-actor/src/mgr/create.rs +++ b/yazi-actor/src/mgr/create.rs @@ -14,11 +14,11 @@ use crate::{Actor, Ctx}; pub struct Create; impl Actor for Create { - type Options = CreateForm; + type Form = CreateForm; const NAME: &str = "create"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let cwd = cx.cwd().to_owned(); let mut input = InputProxy::show(InputCfg::create(opt.dir)); diff --git a/yazi-actor/src/mgr/displace.rs b/yazi-actor/src/mgr/displace.rs index eb858341..c6339beb 100644 --- a/yazi-actor/src/mgr/displace.rs +++ b/yazi-actor/src/mgr/displace.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx}; pub struct Displace; impl Actor for Displace { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "displace"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { if cx.cwd().is_absolute() { succ!(); } diff --git a/yazi-actor/src/mgr/displace_do.rs b/yazi-actor/src/mgr/displace_do.rs index 2e488ad2..172629f7 100644 --- a/yazi-actor/src/mgr/displace_do.rs +++ b/yazi-actor/src/mgr/displace_do.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct DisplaceDo; impl Actor for DisplaceDo { - type Options = DisplaceDoForm; + type Form = DisplaceDoForm; const NAME: &str = "displace_do"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { if cx.cwd() != opt.from { succ!() } diff --git a/yazi-actor/src/mgr/download.rs b/yazi-actor/src/mgr/download.rs index 566f233d..c583f612 100644 --- a/yazi-actor/src/mgr/download.rs +++ b/yazi-actor/src/mgr/download.rs @@ -16,11 +16,11 @@ use crate::{Actor, Ctx}; pub struct Download; impl Actor for Download { - type Options = DownloadForm; + type Form = DownloadForm; const NAME: &str = "download"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let cwd = cx.cwd().clone(); let scheduler = cx.tasks.scheduler.clone(); diff --git a/yazi-actor/src/mgr/enter.rs b/yazi-actor/src/mgr/enter.rs index 8fc110b7..54c9aead 100644 --- a/yazi-actor/src/mgr/enter.rs +++ b/yazi-actor/src/mgr/enter.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Enter; impl Actor for Enter { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "enter"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let Some(h) = cx.hovered().filter(|h| h.is_dir()) else { succ!() }; let url = if h.url.is_search() { h.url.to_regular()? } else { h.url.clone() }; diff --git a/yazi-actor/src/mgr/escape.rs b/yazi-actor/src/mgr/escape.rs index fdeacc54..ea0ab495 100644 --- a/yazi-actor/src/mgr/escape.rs +++ b/yazi-actor/src/mgr/escape.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Escape; impl Actor for Escape { - type Options = EscapeForm; + type Form = EscapeForm; const NAME: &str = "escape"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { if opt.is_empty() { _ = act!(mgr:escape_find, cx)? != false || act!(mgr:escape_visual, cx)? != false @@ -46,11 +46,11 @@ impl Actor for Escape { pub struct EscapeFind; impl Actor for EscapeFind { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "escape_find"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { succ!(render_and!(cx.tab_mut().finder.take().is_some())) } } @@ -59,11 +59,11 @@ impl Actor for EscapeFind { pub struct EscapeVisual; impl Actor for EscapeVisual { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "escape_visual"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let tab = cx.tab_mut(); let select = tab.mode.is_select(); @@ -91,11 +91,11 @@ impl Actor for EscapeVisual { pub struct EscapeFilter; impl Actor for EscapeFilter { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "escape_filter"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { if cx.current_mut().files.filter().is_none() { succ!(false); } @@ -110,11 +110,11 @@ impl Actor for EscapeFilter { pub struct EscapeSelect; impl Actor for EscapeSelect { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "escape_select"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let tab = cx.tab_mut(); if tab.selected.is_empty() { succ!(false); @@ -134,11 +134,11 @@ impl Actor for EscapeSelect { pub struct EscapeSearch; impl Actor for EscapeSearch { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "escape_search"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let b = cx.cwd().is_search(); act!(mgr:search_stop, cx)?; succ!(render_and!(b)); diff --git a/yazi-actor/src/mgr/filter.rs b/yazi-actor/src/mgr/filter.rs index 7c590819..a0c52696 100644 --- a/yazi-actor/src/mgr/filter.rs +++ b/yazi-actor/src/mgr/filter.rs @@ -16,11 +16,11 @@ use crate::{Actor, Ctx}; pub struct Filter; impl Actor for Filter { - type Options = FilterForm; + type Form = FilterForm; const NAME: &str = "filter"; - fn act(_: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(_: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { let input = InputProxy::show(InputCfg::filter()); tokio::spawn(async move { diff --git a/yazi-actor/src/mgr/filter_do.rs b/yazi-actor/src/mgr/filter_do.rs index d0e97db5..b1758234 100644 --- a/yazi-actor/src/mgr/filter_do.rs +++ b/yazi-actor/src/mgr/filter_do.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct FilterDo; impl Actor for FilterDo { - type Options = FilterForm; + type Form = FilterForm; const NAME: &str = "filter_do"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { let filter = if opt.query.is_empty() { None } else { Some(Filter::new(&opt.query, opt.case)?) }; let hovered = cx.hovered().map(|f| f.urn().into()); diff --git a/yazi-actor/src/mgr/find.rs b/yazi-actor/src/mgr/find.rs index 1a2e2ca1..efb567c2 100644 --- a/yazi-actor/src/mgr/find.rs +++ b/yazi-actor/src/mgr/find.rs @@ -16,11 +16,11 @@ use crate::{Actor, Ctx}; pub struct Find; impl Actor for Find { - type Options = FindForm; + type Form = FindForm; const NAME: &str = "find"; - fn act(_: &mut Ctx, opt: Self::Options) -> Result { + fn act(_: &mut Ctx, opt: Self::Form) -> Result { let input = InputProxy::show(InputCfg::find(opt.prev)); tokio::spawn(async move { diff --git a/yazi-actor/src/mgr/find_arrow.rs b/yazi-actor/src/mgr/find_arrow.rs index ec925444..13826762 100644 --- a/yazi-actor/src/mgr/find_arrow.rs +++ b/yazi-actor/src/mgr/find_arrow.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct FindArrow; impl Actor for FindArrow { - type Options = FindArrowForm; + type Form = FindArrowForm; const NAME: &str = "find_arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tab = cx.tab_mut(); let Some(finder) = &mut tab.finder else { succ!() }; diff --git a/yazi-actor/src/mgr/find_do.rs b/yazi-actor/src/mgr/find_do.rs index 5e4053c2..abc2cf1e 100644 --- a/yazi-actor/src/mgr/find_do.rs +++ b/yazi-actor/src/mgr/find_do.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct FindDo; impl Actor for FindDo { - type Options = FindDoForm; + type Form = FindDoForm; const NAME: &str = "find_do"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { if opt.query.is_empty() { return act!(mgr:escape_find, cx); } diff --git a/yazi-actor/src/mgr/follow.rs b/yazi-actor/src/mgr/follow.rs index 7e055784..b713524b 100644 --- a/yazi-actor/src/mgr/follow.rs +++ b/yazi-actor/src/mgr/follow.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Follow; impl Actor for Follow { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "follow"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let Some(file) = cx.hovered() else { succ!() }; let Some(link_to) = &file.link_to else { succ!() }; let Some(parent) = file.url.parent() else { succ!() }; diff --git a/yazi-actor/src/mgr/forward.rs b/yazi-actor/src/mgr/forward.rs index f0538813..e226f7a7 100644 --- a/yazi-actor/src/mgr/forward.rs +++ b/yazi-actor/src/mgr/forward.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Forward; impl Actor for Forward { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "forward"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { if let Some(u) = cx.tab_mut().backstack.shift_forward().cloned() { act!(mgr:cd, cx, (u, CdSource::Forward))?; } diff --git a/yazi-actor/src/mgr/hardlink.rs b/yazi-actor/src/mgr/hardlink.rs index 87bf306a..48008c8b 100644 --- a/yazi-actor/src/mgr/hardlink.rs +++ b/yazi-actor/src/mgr/hardlink.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Hardlink; impl Actor for Hardlink { - type Options = HardlinkForm; + type Form = HardlinkForm; const NAME: &str = "hardlink"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let mgr = &mut cx.core.mgr; let tab = &mgr.tabs[cx.tab]; diff --git a/yazi-actor/src/mgr/hidden.rs b/yazi-actor/src/mgr/hidden.rs index e399db43..5ed09ab9 100644 --- a/yazi-actor/src/mgr/hidden.rs +++ b/yazi-actor/src/mgr/hidden.rs @@ -10,11 +10,11 @@ use crate::{Actor, Ctx}; pub struct Hidden; impl Actor for Hidden { - type Options = HiddenForm; + type Form = HiddenForm; const NAME: &str = "hidden"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let state = opt.state.bool(cx.tab().pref.show_hidden); cx.tab_mut().pref.show_hidden = state; @@ -51,7 +51,7 @@ impl Actor for Hidden { succ!() } - fn hook(cx: &Ctx, _: &Self::Options) -> Option { + fn hook(cx: &Ctx, _: &Self::Form) -> Option { match cx.source() { Source::Ind => Some(SparkKind::IndHidden), Source::Key => Some(SparkKind::KeyHidden), diff --git a/yazi-actor/src/mgr/hover.rs b/yazi-actor/src/mgr/hover.rs index 37922114..add8ce89 100644 --- a/yazi-actor/src/mgr/hover.rs +++ b/yazi-actor/src/mgr/hover.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Hover; impl Actor for Hover { - type Options = HoverForm; + type Form = HoverForm; const NAME: &str = "hover"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tab = tab!(cx); // Parent should always track CWD diff --git a/yazi-actor/src/mgr/leave.rs b/yazi-actor/src/mgr/leave.rs index ad7a0896..a3b9b7b8 100644 --- a/yazi-actor/src/mgr/leave.rs +++ b/yazi-actor/src/mgr/leave.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Leave; impl Actor for Leave { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "leave"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let url = cx .hovered() .and_then(|h| h.url.parent()) diff --git a/yazi-actor/src/mgr/linemode.rs b/yazi-actor/src/mgr/linemode.rs index 1921a526..0bbf7222 100644 --- a/yazi-actor/src/mgr/linemode.rs +++ b/yazi-actor/src/mgr/linemode.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Linemode; impl Actor for Linemode { - type Options = LinemodeForm; + type Form = LinemodeForm; const NAME: &str = "linemode"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tab = cx.tab_mut(); if opt.new != tab.pref.linemode { diff --git a/yazi-actor/src/mgr/link.rs b/yazi-actor/src/mgr/link.rs index 69ff93f5..1e304cf3 100644 --- a/yazi-actor/src/mgr/link.rs +++ b/yazi-actor/src/mgr/link.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Link; impl Actor for Link { - type Options = LinkForm; + type Form = LinkForm; const NAME: &str = "link"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let mgr = &mut cx.core.mgr; let tab = &mgr.tabs[cx.tab]; diff --git a/yazi-actor/src/mgr/open.rs b/yazi-actor/src/mgr/open.rs index 0ccb6d16..d49bf177 100644 --- a/yazi-actor/src/mgr/open.rs +++ b/yazi-actor/src/mgr/open.rs @@ -13,11 +13,11 @@ use crate::{Actor, Ctx, mgr::Quit}; pub struct Open; impl Actor for Open { - type Options = OpenForm; + type Form = OpenForm; const NAME: &str = "open"; - fn act(cx: &mut Ctx, Self::Options { mut opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { mut opt }: Self::Form) -> Result { if !opt.interactive && ARGS.chooser_file.is_some() { succ!(if !opt.targets.is_empty() { Quit::with_selected(opt.targets) diff --git a/yazi-actor/src/mgr/open_do.rs b/yazi-actor/src/mgr/open_do.rs index 84fba983..95d59e00 100644 --- a/yazi-actor/src/mgr/open_do.rs +++ b/yazi-actor/src/mgr/open_do.rs @@ -12,11 +12,11 @@ use crate::{Actor, Ctx}; pub struct OpenDo; impl Actor for OpenDo { - type Options = OpenDoForm; + type Form = OpenDoForm; const NAME: &str = "open_do"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { let targets: Vec<_> = opt .targets .into_iter() diff --git a/yazi-actor/src/mgr/paste.rs b/yazi-actor/src/mgr/paste.rs index 8e85a517..92d4d7ea 100644 --- a/yazi-actor/src/mgr/paste.rs +++ b/yazi-actor/src/mgr/paste.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Paste; impl Actor for Paste { - type Options = PasteForm; + type Form = PasteForm; const NAME: &str = "paste"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let mgr = &mut cx.core.mgr; let tab = &mgr.tabs[cx.tab]; diff --git a/yazi-actor/src/mgr/peek.rs b/yazi-actor/src/mgr/peek.rs index 9016a7f9..bbcfa6bc 100644 --- a/yazi-actor/src/mgr/peek.rs +++ b/yazi-actor/src/mgr/peek.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Peek; impl Actor for Peek { - type Options = PeekForm; + type Form = PeekForm; const NAME: &str = "peek"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let Some(hovered) = cx.hovered().cloned() else { succ!(cx.tab_mut().preview.reset()); }; diff --git a/yazi-actor/src/mgr/quit.rs b/yazi-actor/src/mgr/quit.rs index 25932cd4..43f8dcd2 100644 --- a/yazi-actor/src/mgr/quit.rs +++ b/yazi-actor/src/mgr/quit.rs @@ -14,11 +14,11 @@ use crate::{Actor, Ctx}; pub struct Quit; impl Actor for Quit { - type Options = QuitForm; + type Form = QuitForm; const NAME: &str = "quit"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { let ongoing = cx.tasks.scheduler.ongoing.clone(); let (left, left_names) = { let ongoing = ongoing.lock(); @@ -58,7 +58,7 @@ impl Actor for Quit { succ!(); } - fn hook(cx: &Ctx, _opt: &Self::Options) -> Option { + fn hook(cx: &Ctx, _opt: &Self::Form) -> Option { Some(SparkKind::KeyQuit).filter(|_| cx.source().is_key()) } } diff --git a/yazi-actor/src/mgr/refresh.rs b/yazi-actor/src/mgr/refresh.rs index 5a8cf2b9..00b05022 100644 --- a/yazi-actor/src/mgr/refresh.rs +++ b/yazi-actor/src/mgr/refresh.rs @@ -12,11 +12,11 @@ use crate::{Actor, Ctx}; pub struct Refresh; impl Actor for Refresh { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "refresh"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { CWD.set(cx.cwd(), Self::cwd_changed); if let Some(p) = cx.parent() { diff --git a/yazi-actor/src/mgr/remove.rs b/yazi-actor/src/mgr/remove.rs index b576a65b..b62f7dbd 100644 --- a/yazi-actor/src/mgr/remove.rs +++ b/yazi-actor/src/mgr/remove.rs @@ -10,11 +10,11 @@ use crate::{Actor, Ctx}; pub struct Remove; impl Actor for Remove { - type Options = RemoveForm; + type Form = RemoveForm; const NAME: &str = "remove"; - fn act(cx: &mut Ctx, mut opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, mut opt: Self::Form) -> Result { act!(mgr:escape_visual, cx)?; opt.targets = if opt.hovered { @@ -48,11 +48,11 @@ impl Actor for Remove { pub struct RemoveDo; impl Actor for RemoveDo { - type Options = RemoveForm; + type Form = RemoveForm; const NAME: &str = "remove_do"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let mgr = &mut cx.mgr; mgr.tabs.iter_mut().for_each(|t| { diff --git a/yazi-actor/src/mgr/rename.rs b/yazi-actor/src/mgr/rename.rs index 8e4d10eb..a91e5552 100644 --- a/yazi-actor/src/mgr/rename.rs +++ b/yazi-actor/src/mgr/rename.rs @@ -15,11 +15,11 @@ use crate::{Actor, Ctx}; pub struct Rename; impl Actor for Rename { - type Options = RenameForm; + type Form = RenameForm; const NAME: &str = "rename"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(mgr:escape_visual, cx)?; if !opt.hovered && !cx.tab().selected.is_empty() { diff --git a/yazi-actor/src/mgr/reveal.rs b/yazi-actor/src/mgr/reveal.rs index 5f1801b2..35a3bf4f 100644 --- a/yazi-actor/src/mgr/reveal.rs +++ b/yazi-actor/src/mgr/reveal.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Reveal; impl Actor for Reveal { - type Options = RevealForm; + type Form = RevealForm; const NAME: &str = "reveal"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let Some((parent, child)) = opt.target.pair() else { succ!() }; // Cd to the parent directory diff --git a/yazi-actor/src/mgr/search.rs b/yazi-actor/src/mgr/search.rs index 1b029a7c..2dae9fcb 100644 --- a/yazi-actor/src/mgr/search.rs +++ b/yazi-actor/src/mgr/search.rs @@ -19,11 +19,11 @@ use crate::{Actor, Ctx}; pub struct Search; impl Actor for Search { - type Options = SearchForm; + type Form = SearchForm; const NAME: &str = "search"; - fn act(cx: &mut Ctx, Self::Options { mut opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { mut opt }: Self::Form) -> Result { if let Some(handle) = cx.tab_mut().search.take() { handle.abort(); } @@ -45,11 +45,11 @@ impl Actor for Search { pub struct SearchDo; impl Actor for SearchDo { - type Options = SearchForm; + type Form = SearchForm; const NAME: &str = "search_do"; - fn act(cx: &mut Ctx, Self::Options { opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt }: Self::Form) -> Result { let tab = cx.tab_mut(); if let Some(handle) = tab.search.take() { handle.abort(); @@ -103,11 +103,11 @@ impl Actor for SearchDo { pub struct SearchStop; impl Actor for SearchStop { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "search_stop"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let tab = cx.tab_mut(); if let Some(handle) = tab.search.take() { handle.abort(); diff --git a/yazi-actor/src/mgr/seek.rs b/yazi-actor/src/mgr/seek.rs index 77c2b0f5..f5cddbf1 100644 --- a/yazi-actor/src/mgr/seek.rs +++ b/yazi-actor/src/mgr/seek.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx}; pub struct Seek; impl Actor for Seek { - type Options = SeekForm; + type Form = SeekForm; const NAME: &str = "seek"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let Some(hovered) = cx.hovered() else { succ!(cx.tab_mut().preview.reset()); }; diff --git a/yazi-actor/src/mgr/shell.rs b/yazi-actor/src/mgr/shell.rs index 95949013..30900820 100644 --- a/yazi-actor/src/mgr/shell.rs +++ b/yazi-actor/src/mgr/shell.rs @@ -14,11 +14,11 @@ use crate::{Actor, Ctx}; pub struct Shell; impl Actor for Shell { - type Options = ShellForm; + type Form = ShellForm; const NAME: &str = "shell"; - fn act(cx: &mut Ctx, mut opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, mut opt: Self::Form) -> Result { act!(mgr:escape_visual, cx)?; let cwd = opt.cwd.take().unwrap_or(cx.cwd().into()).into_owned(); diff --git a/yazi-actor/src/mgr/sort.rs b/yazi-actor/src/mgr/sort.rs index 7ea04bd4..d4e28374 100644 --- a/yazi-actor/src/mgr/sort.rs +++ b/yazi-actor/src/mgr/sort.rs @@ -10,11 +10,11 @@ use crate::{Actor, Ctx}; pub struct Sort; impl Actor for Sort { - type Options = SortForm; + type Form = SortForm; const NAME: &str = "sort"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let pref = &mut cx.tab_mut().pref; pref.sort_by = opt.by.unwrap_or(pref.sort_by); pref.sort_reverse = opt.reverse.unwrap_or(pref.sort_reverse); @@ -58,7 +58,7 @@ impl Actor for Sort { succ!(); } - fn hook(cx: &Ctx, _: &Self::Options) -> Option { + fn hook(cx: &Ctx, _: &Self::Form) -> Option { match cx.source() { Source::Ind => Some(SparkKind::IndSort), Source::Key => Some(SparkKind::KeySort), diff --git a/yazi-actor/src/mgr/spot.rs b/yazi-actor/src/mgr/spot.rs index dc35f2dd..61271f46 100644 --- a/yazi-actor/src/mgr/spot.rs +++ b/yazi-actor/src/mgr/spot.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Spot; impl Actor for Spot { - type Options = SpotOpt; + type Form = SpotOpt; const NAME: &str = "spot"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(mgr:escape_visual, cx)?; let Some(hovered) = cx.hovered().cloned() else { succ!() }; diff --git a/yazi-actor/src/mgr/stash.rs b/yazi-actor/src/mgr/stash.rs index 13feb7e3..3de22742 100644 --- a/yazi-actor/src/mgr/stash.rs +++ b/yazi-actor/src/mgr/stash.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Stash; impl Actor for Stash { - type Options = StashForm; + type Form = StashForm; const NAME: &str = "stash"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { if opt.target.is_absolute() && opt.target.is_internal() { cx.tab_mut().backstack.push(opt.target.as_url()); } @@ -20,7 +20,7 @@ impl Actor for Stash { succ!() } - fn hook(cx: &Ctx, _opt: &Self::Options) -> Option { + fn hook(cx: &Ctx, _opt: &Self::Form) -> Option { match cx.source() { Source::Ind => Some(SparkKind::IndStash), Source::Relay => Some(SparkKind::RelayStash), diff --git a/yazi-actor/src/mgr/suspend.rs b/yazi-actor/src/mgr/suspend.rs index 312999e3..6db3263b 100644 --- a/yazi-actor/src/mgr/suspend.rs +++ b/yazi-actor/src/mgr/suspend.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Suspend; impl Actor for Suspend { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "suspend"; - fn act(_: &mut Ctx, _: Self::Options) -> Result { + fn act(_: &mut Ctx, _: Self::Form) -> Result { #[cfg(unix)] if !yazi_shared::session_leader() { unsafe { diff --git a/yazi-actor/src/mgr/tab_close.rs b/yazi-actor/src/mgr/tab_close.rs index c7c60caa..cc4ad9d9 100644 --- a/yazi-actor/src/mgr/tab_close.rs +++ b/yazi-actor/src/mgr/tab_close.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct TabClose; impl Actor for TabClose { - type Options = TabCloseForm; + type Form = TabCloseForm; const NAME: &str = "tab_close"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let len = cx.tabs().len(); if len < 2 || opt.idx >= len { succ!(); diff --git a/yazi-actor/src/mgr/tab_create.rs b/yazi-actor/src/mgr/tab_create.rs index dfbf2713..1d807170 100644 --- a/yazi-actor/src/mgr/tab_create.rs +++ b/yazi-actor/src/mgr/tab_create.rs @@ -12,11 +12,11 @@ const MAX_TABS: usize = 9; pub struct TabCreate; impl Actor for TabCreate { - type Options = TabCreateForm; + type Form = TabCreateForm; const NAME: &str = "tab_create"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { if cx.tabs().len() >= MAX_TABS { succ!(NotifyProxy::push_warn( "Too many tabs", diff --git a/yazi-actor/src/mgr/tab_rename.rs b/yazi-actor/src/mgr/tab_rename.rs index aeeefd1a..d2a32e56 100644 --- a/yazi-actor/src/mgr/tab_rename.rs +++ b/yazi-actor/src/mgr/tab_rename.rs @@ -13,11 +13,11 @@ use crate::{Actor, Ctx}; pub struct TabRename; impl Actor for TabRename { - type Options = TabRenameForm; + type Form = TabRenameForm; const NAME: &str = "tab_rename"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tab = cx.tab().id; let pref = &mut cx.tab_mut().pref; diff --git a/yazi-actor/src/mgr/tab_swap.rs b/yazi-actor/src/mgr/tab_swap.rs index 6ef260ea..73df8bc7 100644 --- a/yazi-actor/src/mgr/tab_swap.rs +++ b/yazi-actor/src/mgr/tab_swap.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct TabSwap; impl Actor for TabSwap { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "tab_swap"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tabs = cx.tabs_mut(); let new = opt.step.add(tabs.cursor, tabs.len(), 0); diff --git a/yazi-actor/src/mgr/tab_switch.rs b/yazi-actor/src/mgr/tab_switch.rs index 3e047545..9230b727 100644 --- a/yazi-actor/src/mgr/tab_switch.rs +++ b/yazi-actor/src/mgr/tab_switch.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct TabSwitch; impl Actor for TabSwitch { - type Options = TabSwitchForm; + type Form = TabSwitchForm; const NAME: &str = "tab_switch"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tabs = cx.tabs_mut(); let idx = if opt.relative { opt.step.saturating_add_unsigned(tabs.cursor).rem_euclid(tabs.len() as _) as _ diff --git a/yazi-actor/src/mgr/toggle.rs b/yazi-actor/src/mgr/toggle.rs index 99e00205..ec08d508 100644 --- a/yazi-actor/src/mgr/toggle.rs +++ b/yazi-actor/src/mgr/toggle.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Toggle; impl Actor for Toggle { - type Options = ToggleForm; + type Form = ToggleForm; const NAME: &str = "toggle"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tab = cx.tab_mut(); let Some(url) = opt.url.or(tab.current.hovered().map(|h| UrlCow::from(&h.url))) else { succ!(); diff --git a/yazi-actor/src/mgr/toggle_all.rs b/yazi-actor/src/mgr/toggle_all.rs index 1127cbae..239f7003 100644 --- a/yazi-actor/src/mgr/toggle_all.rs +++ b/yazi-actor/src/mgr/toggle_all.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct ToggleAll; impl Actor for ToggleAll { - type Options = ToggleAllForm; + type Form = ToggleAllForm; const NAME: &str = "toggle_all"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { use either::Either::*; let tab = cx.tab_mut(); diff --git a/yazi-actor/src/mgr/unyank.rs b/yazi-actor/src/mgr/unyank.rs index d1c7a29d..c15aa28a 100644 --- a/yazi-actor/src/mgr/unyank.rs +++ b/yazi-actor/src/mgr/unyank.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Unyank; impl Actor for Unyank { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "unyank"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let repeek = cx.hovered().is_some_and(|f| f.is_dir() && cx.mgr.yanked.contains_in(&f.url)); cx.mgr.yanked.clear(); diff --git a/yazi-actor/src/mgr/update_files.rs b/yazi-actor/src/mgr/update_files.rs index 0468e7d6..f4918eef 100644 --- a/yazi-actor/src/mgr/update_files.rs +++ b/yazi-actor/src/mgr/update_files.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx}; pub struct UpdateFiles; impl Actor for UpdateFiles { - type Options = UpdateFilesForm; + type Form = UpdateFilesForm; const NAME: &str = "update_files"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let revision = cx.current().files.revision; let linked: Vec<_> = LINKED.read().from_dir(opt.op.cwd()).map(|u| opt.op.chdir(u)).collect(); diff --git a/yazi-actor/src/mgr/update_mimes.rs b/yazi-actor/src/mgr/update_mimes.rs index b076430c..2ed894e9 100644 --- a/yazi-actor/src/mgr/update_mimes.rs +++ b/yazi-actor/src/mgr/update_mimes.rs @@ -10,11 +10,11 @@ use crate::{Actor, Ctx}; pub struct UpdateMimes; impl Actor for UpdateMimes { - type Options = UpdateMimesForm; + type Form = UpdateMimesForm; const NAME: &str = "update_mimes"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let linked = LINKED.read(); let updates = opt .updates diff --git a/yazi-actor/src/mgr/update_paged.rs b/yazi-actor/src/mgr/update_paged.rs index f2e90201..adff2853 100644 --- a/yazi-actor/src/mgr/update_paged.rs +++ b/yazi-actor/src/mgr/update_paged.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct UpdatePaged; impl Actor for UpdatePaged { - type Options = UpdatePagedForm; + type Form = UpdatePagedForm; const NAME: &str = "update_paged"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { if opt.only_if.is_some_and(|u| u != *cx.cwd()) { succ!(); } diff --git a/yazi-actor/src/mgr/update_peeked.rs b/yazi-actor/src/mgr/update_peeked.rs index 499e3669..150ae25e 100644 --- a/yazi-actor/src/mgr/update_peeked.rs +++ b/yazi-actor/src/mgr/update_peeked.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct UpdatePeeked; impl Actor for UpdatePeeked { - type Options = UpdatePeekedForm; + type Form = UpdatePeekedForm; const NAME: &str = "update_peeked"; - fn act(cx: &mut Ctx, form: Self::Options) -> Result { + fn act(cx: &mut Ctx, form: Self::Form) -> Result { let Some(hovered) = cx.hovered().map(|h| &h.url) else { succ!(cx.tab_mut().preview.reset()); }; diff --git a/yazi-actor/src/mgr/update_spotted.rs b/yazi-actor/src/mgr/update_spotted.rs index ad3471c1..4f0f23ad 100644 --- a/yazi-actor/src/mgr/update_spotted.rs +++ b/yazi-actor/src/mgr/update_spotted.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct UpdateSpotted; impl Actor for UpdateSpotted { - type Options = UpdateSpottedForm; + type Form = UpdateSpottedForm; const NAME: &str = "update_spotted"; - fn act(cx: &mut Ctx, mut form: Self::Options) -> Result { + fn act(cx: &mut Ctx, mut form: Self::Form) -> Result { let tab = cx.tab_mut(); let Some(hovered) = tab.hovered().map(|h| &h.url) else { succ!(tab.spot.reset()); diff --git a/yazi-actor/src/mgr/update_yanked.rs b/yazi-actor/src/mgr/update_yanked.rs index ed0f41bb..d2485d46 100644 --- a/yazi-actor/src/mgr/update_yanked.rs +++ b/yazi-actor/src/mgr/update_yanked.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct UpdateYanked; impl Actor for UpdateYanked { - type Options = UpdateYankedForm<'static>; + type Form = UpdateYankedForm<'static>; const NAME: &str = "update_yanked"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { if opt.urls.is_empty() && cx.mgr.yanked.is_empty() { succ!(); } diff --git a/yazi-actor/src/mgr/upload.rs b/yazi-actor/src/mgr/upload.rs index a5a59a7a..93cd8fd5 100644 --- a/yazi-actor/src/mgr/upload.rs +++ b/yazi-actor/src/mgr/upload.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Upload; impl Actor for Upload { - type Options = UploadForm; + type Form = UploadForm; const NAME: &str = "upload"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { for url in opt.urls { cx.tasks.scheduler.file_upload(url.into_owned()); } diff --git a/yazi-actor/src/mgr/visual_mode.rs b/yazi-actor/src/mgr/visual_mode.rs index 8c62ef6f..e30a4b65 100644 --- a/yazi-actor/src/mgr/visual_mode.rs +++ b/yazi-actor/src/mgr/visual_mode.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx}; pub struct VisualMode; impl Actor for VisualMode { - type Options = VisualModeForm; + type Form = VisualModeForm; const NAME: &str = "visual_mode"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tab = cx.tab_mut(); let idx = tab.current.cursor; diff --git a/yazi-actor/src/mgr/watch.rs b/yazi-actor/src/mgr/watch.rs index e85f2349..d1dcea18 100644 --- a/yazi-actor/src/mgr/watch.rs +++ b/yazi-actor/src/mgr/watch.rs @@ -10,11 +10,11 @@ use crate::{Actor, Ctx}; pub struct Watch; impl Actor for Watch { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "watch"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let it = iter::once(cx.core.mgr.tabs.active().cwd()) .chain(cx.core.mgr.tabs.parent().map(|p| &p.url)) .chain(cx.core.mgr.tabs.hovered().filter(|h| h.is_dir()).map(|h| &h.url)); diff --git a/yazi-actor/src/mgr/yank.rs b/yazi-actor/src/mgr/yank.rs index 146561ac..21c9ca1e 100644 --- a/yazi-actor/src/mgr/yank.rs +++ b/yazi-actor/src/mgr/yank.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Yank; impl Actor for Yank { - type Options = YankForm; + type Form = YankForm; const NAME: &str = "yank"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(mgr:escape_visual, cx)?; cx.mgr.yanked = diff --git a/yazi-actor/src/notify/push.rs b/yazi-actor/src/notify/push.rs index 90274661..ff7f82cf 100644 --- a/yazi-actor/src/notify/push.rs +++ b/yazi-actor/src/notify/push.rs @@ -11,11 +11,11 @@ use crate::{Actor, Ctx}; pub struct Push; impl Actor for Push { - type Options = PushForm; + type Form = PushForm; const NAME: &str = "push"; - fn act(cx: &mut Ctx, form: Self::Options) -> Result { + fn act(cx: &mut Ctx, form: Self::Form) -> Result { let instant = Instant::now(); let mut msg = Message::from(form.opt); @@ -28,7 +28,7 @@ impl Actor for Push { succ!(); } - fn hook(cx: &Ctx, _: &Self::Options) -> Option { + fn hook(cx: &Ctx, _: &Self::Form) -> Option { match cx.source() { Source::Relay => Some(SparkKind::RelayNotifyPush), _ => None, diff --git a/yazi-actor/src/notify/tick.rs b/yazi-actor/src/notify/tick.rs index 916d238a..950555c2 100644 --- a/yazi-actor/src/notify/tick.rs +++ b/yazi-actor/src/notify/tick.rs @@ -14,11 +14,11 @@ use crate::{Actor, Ctx}; pub struct Tick; impl Actor for Tick { - type Options = TickForm; + type Form = TickForm; const NAME: &str = "tick"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { cx.notify.ticker.take().map(|h| h.abort()); let Dimension { rows, columns, .. } = Dimension::available(); diff --git a/yazi-actor/src/pick/arrow.rs b/yazi-actor/src/pick/arrow.rs index efc7e073..bb88b165 100644 --- a/yazi-actor/src/pick/arrow.rs +++ b/yazi-actor/src/pick/arrow.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Arrow; impl Actor for Arrow { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { succ!(render!(cx.pick.scroll(opt.step))); } } diff --git a/yazi-actor/src/pick/close.rs b/yazi-actor/src/pick/close.rs index b4003a63..7c02a0e0 100644 --- a/yazi-actor/src/pick/close.rs +++ b/yazi-actor/src/pick/close.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Close; impl Actor for Close { - type Options = CloseForm; + type Form = CloseForm; const NAME: &str = "close"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let pick = &mut cx.pick; if let Some(cb) = pick.callback.take() { _ = cb.send(if opt.submit { Some(pick.cursor) } else { None }); diff --git a/yazi-actor/src/pick/show.rs b/yazi-actor/src/pick/show.rs index 3eab8679..b509acbf 100644 --- a/yazi-actor/src/pick/show.rs +++ b/yazi-actor/src/pick/show.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Show; impl Actor for Show { - type Options = ShowForm; + type Form = ShowForm; const NAME: &str = "show"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(pick:close, cx)?; let pick = &mut cx.pick; diff --git a/yazi-actor/src/spot/arrow.rs b/yazi-actor/src/spot/arrow.rs index a56b54d2..e1eb0b51 100644 --- a/yazi-actor/src/spot/arrow.rs +++ b/yazi-actor/src/spot/arrow.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Arrow; impl Actor for Arrow { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let spot = &mut cx.tab_mut().spot; let Some(lock) = &mut spot.lock else { succ!() }; diff --git a/yazi-actor/src/spot/close.rs b/yazi-actor/src/spot/close.rs index acc84cc9..ec405a96 100644 --- a/yazi-actor/src/spot/close.rs +++ b/yazi-actor/src/spot/close.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Close; impl Actor for Close { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "close"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { succ!(cx.tab_mut().spot.reset()); } } diff --git a/yazi-actor/src/spot/copy.rs b/yazi-actor/src/spot/copy.rs index bc7a61ea..c04294b7 100644 --- a/yazi-actor/src/spot/copy.rs +++ b/yazi-actor/src/spot/copy.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Copy; impl Actor for Copy { - type Options = CopyForm; + type Form = CopyForm; const NAME: &str = "copy"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let spot = &cx.tab().spot; let Some(lock) = &spot.lock else { succ!() }; let Some(table) = lock.table() else { succ!() }; diff --git a/yazi-actor/src/spot/swipe.rs b/yazi-actor/src/spot/swipe.rs index 0767c3af..5bf195cf 100644 --- a/yazi-actor/src/spot/swipe.rs +++ b/yazi-actor/src/spot/swipe.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Swipe; impl Actor for Swipe { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "swipe"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { act!(mgr:arrow, cx, opt)?; act!(mgr:spot, cx) } diff --git a/yazi-actor/src/tasks/arrow.rs b/yazi-actor/src/tasks/arrow.rs index 4c2a41e9..6687ced3 100644 --- a/yazi-actor/src/tasks/arrow.rs +++ b/yazi-actor/src/tasks/arrow.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Arrow; impl Actor for Arrow { - type Options = ArrowForm; + type Form = ArrowForm; const NAME: &str = "arrow"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { let tasks = &mut cx.tasks; let old = tasks.cursor; diff --git a/yazi-actor/src/tasks/cancel.rs b/yazi-actor/src/tasks/cancel.rs index fe216474..3e39a7ba 100644 --- a/yazi-actor/src/tasks/cancel.rs +++ b/yazi-actor/src/tasks/cancel.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Cancel; impl Actor for Cancel { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "cancel"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let tasks = &mut cx.tasks; let id = tasks.scheduler.ongoing.lock().get_id(tasks.cursor); diff --git a/yazi-actor/src/tasks/close.rs b/yazi-actor/src/tasks/close.rs index c78d930f..6635d0da 100644 --- a/yazi-actor/src/tasks/close.rs +++ b/yazi-actor/src/tasks/close.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Close; impl Actor for Close { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "close"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let tasks = &mut cx.tasks; if !tasks.visible { succ!(); diff --git a/yazi-actor/src/tasks/inspect.rs b/yazi-actor/src/tasks/inspect.rs index 5e1cdf82..781c7257 100644 --- a/yazi-actor/src/tasks/inspect.rs +++ b/yazi-actor/src/tasks/inspect.rs @@ -17,11 +17,11 @@ use crate::{Actor, Ctx}; pub struct Inspect; impl Actor for Inspect { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "inspect"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let ongoing = cx.tasks.scheduler.ongoing.clone(); let Some(id) = ongoing.lock().get_id(cx.tasks.cursor) else { succ!(); diff --git a/yazi-actor/src/tasks/open_shell_compat.rs b/yazi-actor/src/tasks/open_shell_compat.rs index 0cc0f1cb..ff1fb3c1 100644 --- a/yazi-actor/src/tasks/open_shell_compat.rs +++ b/yazi-actor/src/tasks/open_shell_compat.rs @@ -9,11 +9,11 @@ pub struct OpenShellCompat; // TODO: remove impl Actor for OpenShellCompat { - type Options = ProcessOpenForm; + type Form = ProcessOpenForm; const NAME: &str = "open_shell_compat"; - fn act(cx: &mut Ctx, Self::Options { opt, .. }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { opt, .. }: Self::Form) -> Result { succ!(cx.tasks.open_shell_compat(opt)); } } diff --git a/yazi-actor/src/tasks/process_open.rs b/yazi-actor/src/tasks/process_open.rs index ffa61184..519d8aaa 100644 --- a/yazi-actor/src/tasks/process_open.rs +++ b/yazi-actor/src/tasks/process_open.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct ProcessOpen; impl Actor for ProcessOpen { - type Options = ProcessOpenForm; + type Form = ProcessOpenForm; const NAME: &str = "process_open"; - fn act(cx: &mut Ctx, form: Self::Options) -> Result { + fn act(cx: &mut Ctx, form: Self::Form) -> Result { let done = cx.tasks.scheduler.process_open(form.opt); if let Some(replier) = form.replier { diff --git a/yazi-actor/src/tasks/show.rs b/yazi-actor/src/tasks/show.rs index ffed942a..f1b4026e 100644 --- a/yazi-actor/src/tasks/show.rs +++ b/yazi-actor/src/tasks/show.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Show; impl Actor for Show { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "show"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { let tasks = &mut cx.tasks; if tasks.visible { succ!(); diff --git a/yazi-actor/src/tasks/update_succeed.rs b/yazi-actor/src/tasks/update_succeed.rs index cfd9dac8..2bd31d43 100644 --- a/yazi-actor/src/tasks/update_succeed.rs +++ b/yazi-actor/src/tasks/update_succeed.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct UpdateSucceed; impl Actor for UpdateSucceed { - type Options = UpdateSucceedForm; + type Form = UpdateSucceedForm; const NAME: &str = "update_succeed"; - fn act(cx: &mut Ctx, opt: Self::Options) -> Result { + fn act(cx: &mut Ctx, opt: Self::Form) -> Result { if opt.urls.is_empty() { succ!(); } diff --git a/yazi-actor/src/which/activate.rs b/yazi-actor/src/which/activate.rs index fd975825..4cf42b3d 100644 --- a/yazi-actor/src/which/activate.rs +++ b/yazi-actor/src/which/activate.rs @@ -9,11 +9,11 @@ use crate::{Actor, Ctx}; pub struct Activate; impl Actor for Activate { - type Options = ActivateForm; + type Form = ActivateForm; const NAME: &str = "activate"; - fn act(cx: &mut Ctx, Self::Options { mut opt }: Self::Options) -> Result { + fn act(cx: &mut Ctx, Self::Form { mut opt }: Self::Form) -> Result { opt.cands.retain(|c| c.on.len() > opt.times); WhichSorter::default().sort(&mut opt.cands); @@ -31,7 +31,7 @@ impl Actor for Activate { succ!(render!()); } - fn hook(cx: &Ctx, _opt: &Self::Options) -> Option { + fn hook(cx: &Ctx, _opt: &Self::Form) -> Option { match cx.source() { Source::Unknown => Some(SparkKind::IndWhichActivate), _ => None, diff --git a/yazi-actor/src/which/dismiss.rs b/yazi-actor/src/which/dismiss.rs index c834d4b1..c26b4034 100644 --- a/yazi-actor/src/which/dismiss.rs +++ b/yazi-actor/src/which/dismiss.rs @@ -8,11 +8,11 @@ use crate::{Actor, Ctx}; pub struct Dismiss; impl Actor for Dismiss { - type Options = VoidForm; + type Form = VoidForm; const NAME: &str = "dismiss"; - fn act(cx: &mut Ctx, _: Self::Options) -> Result { + fn act(cx: &mut Ctx, _: Self::Form) -> Result { succ!(cx.which.dismiss(None)); } } diff --git a/yazi-macro/src/actor.rs b/yazi-macro/src/actor.rs index 28ade8c7..3bbd65a4 100644 --- a/yazi-macro/src/actor.rs +++ b/yazi-macro/src/actor.rs @@ -25,12 +25,12 @@ macro_rules! act { }}; ($layer:ident : $name:ident, $cx:ident, $action:expr) => { - ::Options::try_from($action) + ::Form::try_from($action) .map_err(anyhow::Error::from) .and_then(|opt| act!(@impl $layer:$name, $cx, opt)) }; ($layer:ident : $name:ident, $cx:ident) => { - act!($layer:$name, $cx, <::Options as Default>::default()) + act!($layer:$name, $cx, <::Form as Default>::default()) }; ($layer:ident : $name:ident) => { paste::paste! { yazi_actor::$layer::[<$name:camel>] }