Avoid re-allocating KeymapContext
after every view notification
This commit is contained in:
parent
18e39ef2fa
commit
3d679ddb26
12 changed files with 74 additions and 75 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ use gpui::{
|
|||
vector::{vec2f, Vector2F},
|
||||
},
|
||||
impl_actions,
|
||||
keymap_matcher::KeymapContext,
|
||||
platform::{
|
||||
CursorStyle, MouseButton, PathPromptOptions, Platform, PromptLevel, WindowBounds,
|
||||
WindowOptions,
|
||||
|
@ -2809,10 +2808,6 @@ impl View for Workspace {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn keymap_context(&self, _: &AppContext) -> KeymapContext {
|
||||
Self::default_keymap_context()
|
||||
}
|
||||
}
|
||||
|
||||
impl ViewId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue