Skip to content

Commit

Permalink
feat: add plugin command to each layer
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Feb 2, 2024
1 parent b51d1f2 commit 5086c02
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion yazi-fm/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
_ => {}
}
}
Expand All @@ -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),
_ => {}
}
}
Expand Down Expand Up @@ -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),
_ => {}
}
}
Expand All @@ -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),
_ => {}
}
}
Expand All @@ -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),
_ => {}
}
}
Expand Down

0 comments on commit 5086c02

Please sign in to comment.