diff options
Diffstat (limited to 'src/key_command/command_keybind.rs')
-rw-r--r-- | src/key_command/command_keybind.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/key_command/command_keybind.rs b/src/key_command/command_keybind.rs index bd58b18..97e5de3 100644 --- a/src/key_command/command_keybind.rs +++ b/src/key_command/command_keybind.rs @@ -3,14 +3,24 @@ use crate::key_command::Command; #[derive(Debug)] pub enum CommandKeybind { - SimpleKeybind(Command), + SimpleKeybind { + command: Command, + description: Option<String>, + }, CompositeKeybind(KeyMapping), } impl std::fmt::Display for CommandKeybind { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - CommandKeybind::SimpleKeybind(s) => write!(f, "{}", s), + CommandKeybind::SimpleKeybind { + command: _, + description: Some(desc), + } => write!(f, "{}", desc), + CommandKeybind::SimpleKeybind { + command: cmd, + description: None, + } => write!(f, "{}", cmd), CommandKeybind::CompositeKeybind(_) => write!(f, "..."), } } |