diff --git a/crates/welcome/src/base_keymap_setting.rs b/crates/welcome/src/base_keymap_setting.rs index 54af63007af38b7796b92a9280aa951056fc6f52..d10e424eb6346a8f4f71f404844bda9b1a714c47 100644 --- a/crates/welcome/src/base_keymap_setting.rs +++ b/crates/welcome/src/base_keymap_setting.rs @@ -15,6 +15,7 @@ pub enum BaseKeymap { SublimeText, Atom, TextMate, + None, } impl Display for BaseKeymap { @@ -25,6 +26,7 @@ impl Display for BaseKeymap { BaseKeymap::SublimeText => write!(f, "Sublime Text"), BaseKeymap::Atom => write!(f, "Atom"), BaseKeymap::TextMate => write!(f, "TextMate"), + BaseKeymap::None => write!(f, "None"), } } } @@ -45,6 +47,7 @@ impl BaseKeymap { BaseKeymap::Atom => Some("keymaps/atom.json"), BaseKeymap::TextMate => Some("keymaps/textmate.json"), BaseKeymap::VSCode => None, + BaseKeymap::None => None, } } diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 19dbbe991362be58ce42758c2435eea3206dab63..9eb221e45033d6f87e9fdeac9039ad52394d1b87 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -641,12 +641,17 @@ fn reload_keymaps(cx: &mut AppContext, keymap_content: &KeymapFile) { } pub fn load_default_keymap(cx: &mut AppContext) { + let base_keymap = *BaseKeymap::get_global(cx); + if base_keymap == BaseKeymap::None { + return; + } + KeymapFile::load_asset(DEFAULT_KEYMAP_PATH, cx).unwrap(); if VimModeSetting::get_global(cx).0 { KeymapFile::load_asset("keymaps/vim.json", cx).unwrap(); } - if let Some(asset_path) = BaseKeymap::get_global(cx).asset_path() { + if let Some(asset_path) = base_keymap.asset_path() { KeymapFile::load_asset(asset_path, cx).unwrap(); } }