From 3248dbd8bbbd5472e4cd762e7b2fcd2feb482344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Tue, 23 Jan 2024 16:45:57 +0800 Subject: [PATCH] feat: support submit completion and input at once by using `` key (#565) --- yazi-config/preset/keymap.toml | 5 +++-- yazi-fm/src/executor.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yazi-config/preset/keymap.toml b/yazi-config/preset/keymap.toml index 3e2aac05..52021f80 100644 --- a/yazi-config/preset/keymap.toml +++ b/yazi-config/preset/keymap.toml @@ -258,8 +258,9 @@ keymap = [ [completion] keymap = [ - { on = [ "" ], exec = "close", desc = "Cancel completion" }, - { on = [ "" ], exec = "close --submit", desc = "Submit the completion" }, + { on = [ "" ], exec = "close", desc = "Cancel completion" }, + { on = [ "" ], exec = "close --submit", desc = "Submit the completion" }, + { on = [ "" ], exec = [ "close --submit", "close_input --submit" ], desc = "Submit the completion and input" }, { on = [ "" ], exec = "arrow -1", desc = "Move cursor up" }, { on = [ "" ], exec = "arrow 1", desc = "Move cursor down" }, diff --git a/yazi-fm/src/executor.rs b/yazi-fm/src/executor.rs index b05b4881..c643a51f 100644 --- a/yazi-fm/src/executor.rs +++ b/yazi-fm/src/executor.rs @@ -270,6 +270,7 @@ impl<'a> Executor<'a> { #[allow(clippy::single_match)] match exec.cmd.as_str() { "help" => self.app.cx.help.toggle(Layer::Completion), + "close_input" => self.app.cx.input.close(exec), _ => {} } }