diff --git a/yazi-core/src/tab/commands/mod.rs b/yazi-core/src/tab/commands/mod.rs index ef5f18c7..6ef89e27 100644 --- a/yazi-core/src/tab/commands/mod.rs +++ b/yazi-core/src/tab/commands/mod.rs @@ -17,6 +17,8 @@ yazi_macro::mod_flat!( preview reveal search + select + select_all shell sort toggle diff --git a/yazi-core/src/tab/commands/select.rs b/yazi-core/src/tab/commands/select.rs new file mode 100644 index 00000000..99720550 --- /dev/null +++ b/yazi-core/src/tab/commands/select.rs @@ -0,0 +1,30 @@ +use std::time::Duration; + +use yazi_shared::event::Cmd; + +use crate::tab::Tab; + +struct Opt; + +impl From for Opt { + fn from(_: Cmd) -> Self { Self } +} + +impl From<()> for Opt { + fn from(_: ()) -> Self { Self } +} + +impl Tab { + // TODO: remove this in Yazi 0.4.1 + #[yazi_codegen::command] + pub fn select(&mut self, _: Opt) { + yazi_proxy::AppProxy::notify(yazi_proxy::options::NotifyOpt { + title: "Deprecated command".to_owned(), + content: "`select` and `select_all` command has been renamed to `toggle` and `toggle_all` in Yazi v0.4 + +Please change it in your keymap.toml, see #1773 for details: https://github.com/sxyazi/yazi/pull/1773".to_owned(), + level: yazi_proxy::options::NotifyLevel::Error, + timeout: Duration::from_secs(20), + }); + } +} diff --git a/yazi-core/src/tab/commands/select_all.rs b/yazi-core/src/tab/commands/select_all.rs new file mode 100644 index 00000000..55ce6cb7 --- /dev/null +++ b/yazi-core/src/tab/commands/select_all.rs @@ -0,0 +1,15 @@ +use yazi_shared::event::Cmd; + +use crate::tab::Tab; + +struct Opt; + +impl From for Opt { + fn from(_: Cmd) -> Self { Self } +} + +impl Tab { + // TODO: remove this in Yazi 0.4.1 + #[yazi_codegen::command] + pub fn select_all(&mut self, _: Opt) { self.select(()); } +} diff --git a/yazi-fm/src/executor.rs b/yazi-fm/src/executor.rs index 9dbc3e73..278f5e23 100644 --- a/yazi-fm/src/executor.rs +++ b/yazi-fm/src/executor.rs @@ -93,6 +93,8 @@ impl<'a> Executor<'a> { on!(ACTIVE, toggle); on!(ACTIVE, toggle_all); on!(ACTIVE, visual_mode); + on!(ACTIVE, select); + on!(ACTIVE, select_all); // Operation on!(MANAGER, open, &self.app.cx.tasks);