From 67e7b791483300e7a99acf7c410334a9a677d1dc Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 18 Jul 2024 13:55:41 +0800 Subject: [PATCH] .. --- yazi-config/src/keymap/control.rs | 2 -- yazi-config/src/lib.rs | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/yazi-config/src/keymap/control.rs b/yazi-config/src/keymap/control.rs index 766861d5..85c6e906 100644 --- a/yazi-config/src/keymap/control.rs +++ b/yazi-config/src/keymap/control.rs @@ -33,8 +33,6 @@ impl Control { if let Some(ref s) = self.desc { Cow::Borrowed(s) } else { self.run().into() } } - pub fn key_desc(&self) -> String { format!("`{}` ({})", self.on(), self.desc_or_run()) } - #[inline] pub fn contains(&self, s: &str) -> bool { let s = s.to_lowercase(); diff --git a/yazi-config/src/lib.rs b/yazi-config/src/lib.rs index 5d058caf..82c63667 100644 --- a/yazi-config/src/lib.rs +++ b/yazi-config/src/lib.rs @@ -65,12 +65,11 @@ pub fn init() -> anyhow::Result<()> { continue; } if !r.bool("confirm") && !r.bool("interactive") { - let key_desc = c.key_desc(); + let s = format!("`{}` ({})", c.on(), c.desc_or_run()); eprintln!( r#"WARNING: In Yazi v0.3, the behavior of the interactive `shell` (i.e., shell templates) must be explicitly specified with either `--interactive` or `--confirm`. -Please replace e.g. `shell` with `shell --interactive`, `shell "my-template"` with `shell "my-template" --interactive`, in your keymap.toml -for the key {key_desc}"# +Please replace e.g. `shell` with `shell --interactive`, `shell "my-template"` with `shell "my-template" --interactive`, in your keymap.toml for the key: {s}"# ); return Ok(()); } else if r.bool("confirm") && r.bool("interactive") {