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

@ -1831,12 +1831,11 @@ impl View for Pane {
});
}
fn keymap_context(&self, _: &AppContext) -> KeymapContext {
let mut keymap = Self::default_keymap_context();
fn update_keymap_context(&self, keymap: &mut KeymapContext, _: &AppContext) {
Self::reset_to_default_keymap_context(keymap);
if self.docked.is_some() {
keymap.add_identifier("docked");
}
keymap
}
}