This commit is contained in:
sxyazi 2024-10-13 18:46:47 +08:00
parent 53b12469d1
commit 88e6973afe
No known key found for this signature in database
4 changed files with 49 additions and 0 deletions

View file

@ -17,6 +17,8 @@ yazi_macro::mod_flat!(
preview
reveal
search
select
select_all
shell
sort
toggle

View file

@ -0,0 +1,30 @@
use std::time::Duration;
use yazi_shared::event::Cmd;
use crate::tab::Tab;
struct Opt;
impl From<Cmd> 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),
});
}
}

View file

@ -0,0 +1,15 @@
use yazi_shared::event::Cmd;
use crate::tab::Tab;
struct Opt;
impl From<Cmd> 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(()); }
}

View file

@ -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);