From 9bdbc5511777f075d02455e2d7aaa82bc8885303 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 5 Jan 2024 15:22:28 +0800 Subject: [PATCH] feat: add new `plugin` command --- yazi-core/src/tab/commands/hidden.rs | 8 +++++++- yazi-fm/src/executor.rs | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/yazi-core/src/tab/commands/hidden.rs b/yazi-core/src/tab/commands/hidden.rs index 333fd454..b3fa7df6 100644 --- a/yazi-core/src/tab/commands/hidden.rs +++ b/yazi-core/src/tab/commands/hidden.rs @@ -10,7 +10,13 @@ impl Tab { _ => !self.conf.show_hidden, }; + let hovered = self.current.hovered().map(|f| f.url()); self.apply_files_attrs(); - Manager::_hover(None); + + if hovered.as_ref() != self.current.hovered().map(|f| &f.url) { + Manager::_hover(hovered); + } else if self.current.hovered().is_some_and(|f| f.is_dir()) { + Manager::_peek(true); + } } } diff --git a/yazi-fm/src/executor.rs b/yazi-fm/src/executor.rs index 69bc042c..a569b5c1 100644 --- a/yazi-fm/src/executor.rs +++ b/yazi-fm/src/executor.rs @@ -172,6 +172,8 @@ impl<'a> Executor<'a> { b"tasks_show" => self.app.cx.tasks.toggle(()), // Help b"help" => self.app.cx.help.toggle(Layer::Manager), + // Plugin + b"plugin" => self.app.plugin(exec), _ => {} } }