Add initial vim mode mode switching

Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Keith Simmons 2022-03-24 19:24:36 -07:00
parent ccc276da7a
commit bb9b36dccd
16 changed files with 683 additions and 49 deletions

View file

@ -224,15 +224,19 @@ impl Keystroke {
key: key.unwrap(),
})
}
pub fn modified(&self) -> bool {
self.ctrl || self.alt || self.shift || self.cmd
}
}
impl Context {
pub fn extend(&mut self, other: Context) {
for v in other.set {
self.set.insert(v);
pub fn extend(&mut self, other: &Context) {
for v in &other.set {
self.set.insert(v.clone());
}
for (k, v) in other.map {
self.map.insert(k, v);
for (k, v) in &other.map {
self.map.insert(k.clone(), v.clone());
}
}
}