Avoid re-allocating KeymapContext after every view notification

This commit is contained in:
Antonio Scandurra 2023-05-04 12:04:30 +02:00
parent 18e39ef2fa
commit 3d679ddb26
12 changed files with 74 additions and 75 deletions

View file

@ -1316,10 +1316,9 @@ impl View for ProjectPanel {
}
}
fn keymap_context(&self, _: &AppContext) -> KeymapContext {
let mut cx = Self::default_keymap_context();
cx.add_identifier("menu");
cx
fn update_keymap_context(&self, keymap: &mut KeymapContext, _: &AppContext) {
Self::reset_to_default_keymap_context(keymap);
keymap.add_identifier("menu");
}
}