Add base keymap setting

Format all files

Co-Authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Mikayla Maki 2023-03-07 12:19:51 -08:00
parent 3b31f10c6f
commit 19fc143209
12 changed files with 301 additions and 35 deletions

View file

@ -1,4 +1,4 @@
use crate::parse_json_with_comments;
use crate::{parse_json_with_comments, Settings};
use anyhow::{Context, Result};
use assets::Assets;
use collections::BTreeMap;
@ -45,6 +45,10 @@ impl KeymapFileContent {
for path in ["keymaps/default.json", "keymaps/vim.json"] {
Self::load(path, cx).unwrap();
}
if let Some(base_keymap) = cx.global::<Settings>().base_keymap {
Self::load(base_keymap.asset_path(), cx).log_err();
}
}
pub fn load(asset_path: &str, cx: &mut MutableAppContext) -> Result<()> {