mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
53b12469d1
commit
88e6973afe
4 changed files with 49 additions and 0 deletions
|
|
@ -17,6 +17,8 @@ yazi_macro::mod_flat!(
|
|||
preview
|
||||
reveal
|
||||
search
|
||||
select
|
||||
select_all
|
||||
shell
|
||||
sort
|
||||
toggle
|
||||
|
|
|
|||
30
yazi-core/src/tab/commands/select.rs
Normal file
30
yazi-core/src/tab/commands/select.rs
Normal 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),
|
||||
});
|
||||
}
|
||||
}
|
||||
15
yazi-core/src/tab/commands/select_all.rs
Normal file
15
yazi-core/src/tab/commands/select_all.rs
Normal 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(()); }
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue