WIP
This commit is contained in:
parent
85ed7b41f1
commit
a8483ba458
11 changed files with 219 additions and 65 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue