diff --git a/yazi-core/src/input/commands/backward.rs b/yazi-core/src/input/commands/backward.rs index 4105e414..55f88de2 100644 --- a/yazi-core/src/input/commands/backward.rs +++ b/yazi-core/src/input/commands/backward.rs @@ -8,6 +8,9 @@ pub struct Opt; impl From<&Exec> for Opt { fn from(_: &Exec) -> Self { Self } } +impl From<()> for Opt { + fn from(_: ()) -> Self { Self } +} impl Input { pub fn backward(&mut self, _: impl Into) -> bool { diff --git a/yazi-core/src/input/commands/forward.rs b/yazi-core/src/input/commands/forward.rs index 55cd685e..3666dc56 100644 --- a/yazi-core/src/input/commands/forward.rs +++ b/yazi-core/src/input/commands/forward.rs @@ -10,6 +10,9 @@ pub struct Opt { impl From<&Exec> for Opt { fn from(e: &Exec) -> Self { Self { end_of_word: e.named.contains_key("end-of-word") } } } +impl From for Opt { + fn from(end_of_word: bool) -> Self { Self { end_of_word } } +} impl Input { pub fn forward(&mut self, opt: impl Into) -> bool { diff --git a/yazi-core/src/input/input.rs b/yazi-core/src/input/input.rs index 47739a12..b8d7bd86 100644 --- a/yazi-core/src/input/input.rs +++ b/yazi-core/src/input/input.rs @@ -67,7 +67,7 @@ impl Input { Key { code: KeyCode::Char('d'), shift: false, ctrl: true, alt: false } => { self.forward_delete() } - Key { code: KeyCode::Char('b'), shift: false, ctrl: false, alt: true } => self.backward(), + Key { code: KeyCode::Char('b'), shift: false, ctrl: false, alt: true } => self.backward(()), Key { code: KeyCode::Char('f'), shift: false, ctrl: false, alt: true } => self.forward(false), _ => false, }