From 5086c0238026b3685ec265213ebef65cf27b0874 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 3 Feb 2024 02:49:44 +0800 Subject: [PATCH] feat: add `plugin` command to each layer --- yazi-fm/src/executor.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/yazi-fm/src/executor.rs b/yazi-fm/src/executor.rs index 6f5951445..7577edf99 100644 --- a/yazi-fm/src/executor.rs +++ b/yazi-fm/src/executor.rs @@ -156,7 +156,10 @@ impl<'a> Executor<'a> { #[allow(clippy::single_match)] match cmd.name.as_str() { + // Help "help" => self.app.cx.help.toggle(Layer::Tasks), + // Plugin + "plugin" => self.app.plugin(cmd), _ => {} } } @@ -176,7 +179,10 @@ impl<'a> Executor<'a> { #[allow(clippy::single_match)] match cmd.name.as_str() { + // Help "help" => self.app.cx.help.toggle(Layer::Select), + // Plugin + "plugin" => self.app.plugin(cmd), _ => {} } } @@ -224,7 +230,10 @@ impl<'a> Executor<'a> { #[allow(clippy::single_match)] match cmd.name.as_str() { + // Help "help" => self.app.cx.help.toggle(Layer::Input), + // Plugin + "plugin" => self.app.plugin(cmd), _ => {} } } @@ -251,6 +260,8 @@ impl<'a> Executor<'a> { #[allow(clippy::single_match)] match cmd.name.as_str() { "close" => self.app.cx.help.toggle(Layer::Help), + // Plugin + "plugin" => self.app.plugin(cmd), _ => {} } } @@ -271,8 +282,11 @@ impl<'a> Executor<'a> { #[allow(clippy::single_match)] match cmd.name.as_str() { - "help" => self.app.cx.help.toggle(Layer::Completion), "close_input" => self.app.cx.input.close(cmd), + // Help + "help" => self.app.cx.help.toggle(Layer::Completion), + // Plugin + "plugin" => self.app.plugin(cmd), _ => {} } }