diff --git a/src/ui/help.rs b/src/ui/help.rs index f63dd63..9ff12fd 100644 --- a/src/ui/help.rs +++ b/src/ui/help.rs @@ -4,8 +4,10 @@ use cursive::theme::Effect; use cursive::utils::markup::StyledString; use cursive::view::ViewWrapper; use cursive::views::{ScrollView, TextView}; +use cursive::Cursive; use crate::command::Command; +use crate::commands::CommandResult; use crate::config::config_path; use crate::traits::ViewExt; @@ -46,4 +48,12 @@ impl ViewExt for HelpView { fn title(&self) -> String { "Help".to_string() } + + fn on_command(&mut self, s: &mut Cursive, cmd: &Command) -> Result { + if let Command::Help = cmd { + Ok(CommandResult::Consumed(None)) + } else { + Ok(CommandResult::Ignored) + } + } }