fix(key bind): space

This commit is contained in:
Ashley Wulber 2026-06-26 14:17:11 -04:00 committed by Michael Murphy
parent e7f37f3e81
commit 18a7a75e33

View file

@ -146,6 +146,7 @@ impl fmt::Display for KeyBind {
write!(f, "{:?} + ", modifier)?;
}
match &self.key {
Key::Character(c) if c.as_str() == " " => write!(f, "Space"),
Key::Character(c) => write!(f, "{}", c.to_uppercase()),
Key::Named(named) => write!(f, "{:?}", named),
other => write!(f, "{:?}", other),
@ -216,6 +217,7 @@ mod test {
};
assert!(bind.matches(Modifiers::CTRL, &Key::Character(" ".into()), None,));
assert!(format!("{}", bind) == String::from("Ctrl + Space"))
}
#[test]