Fix some bugs in keymap handling (#3895)
- `base_keymap` setting was not respected, now it is - without a `~/.config/zed/keymap.json` file, we would fail to load the *default* keymap Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
parent
2da314fb79
commit
5e3d4885bf
4 changed files with 71 additions and 41 deletions
|
@ -370,6 +370,7 @@ mod tests {
|
|||
use gpui::TestAppContext;
|
||||
use language::Point;
|
||||
use project::Project;
|
||||
use settings::KeymapFile;
|
||||
use workspace::{AppState, Workspace};
|
||||
|
||||
#[test]
|
||||
|
@ -503,7 +504,20 @@ mod tests {
|
|||
workspace::init(app_state.clone(), cx);
|
||||
init(cx);
|
||||
Project::init_settings(cx);
|
||||
settings::load_default_keymap(cx);
|
||||
KeymapFile::parse(
|
||||
r#"[
|
||||
{
|
||||
"bindings": {
|
||||
"cmd-n": "workspace::NewFile",
|
||||
"enter": "menu::Confirm",
|
||||
"cmd-shift-p": "command_palette::Toggle"
|
||||
}
|
||||
}
|
||||
]"#,
|
||||
)
|
||||
.unwrap()
|
||||
.add_to_cx(cx)
|
||||
.unwrap();
|
||||
app_state
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue