use crate::commands::*;
use crate::config::AppKeyMapping;
use crate::context::AppContext;
use crate::error::{JoshutoError, JoshutoErrorKind, JoshutoResult};
use crate::ui::AppBackend;
use super::{Command, NumberedExecute};
impl NumberedExecute for Command {
#[allow(unused)] fn numbered_execute(
&self,
number_prefix: usize,
context: &mut AppContext,
backend: &mut AppBackend,
keymap_t: &AppKeyMapping,
) -> JoshutoResult {
match self {
Self::CursorMoveUp(_) => cursor_move::up(context, number_prefix),
Self::CursorMoveDown(_) => cursor_move::down(context, number_prefix),
_ => Err(JoshutoError::new(
JoshutoErrorKind::UnrecognizedCommand,
"Command cannot be prefixed by a number".to_string(),
)),
}
}
}