This commit is contained in:
Antonio Scandurra 2022-05-25 15:24:44 +02:00
parent 85ed7b41f1
commit a8483ba458
11 changed files with 219 additions and 65 deletions

View file

@ -185,7 +185,7 @@ impl Matcher {
return Some(binding.keystrokes.clone());
}
}
todo!()
None
}
}
@ -311,6 +311,34 @@ impl Keystroke {
}
}
impl std::fmt::Display for Keystroke {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if self.ctrl {
write!(f, "{}", "^")?;
}
if self.alt {
write!(f, "{}", "")?;
}
if self.cmd {
write!(f, "{}", "")?;
}
if self.shift {
write!(f, "{}", "")?;
}
let key = match self.key.as_str() {
"backspace" => "",
"up" => "",
"down" => "",
"left" => "",
"right" => "",
"tab" => "",
"escape" => "",
key => key,
};
write!(f, "{}", key)
}
}
impl Context {
pub fn extend(&mut self, other: &Context) {
for v in &other.set {