From 7571899f085f8be4fd838d4c9bca32750ef9d1e7 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 8 Sep 2022 16:37:04 -0700 Subject: [PATCH] Added internal keymaps as well, just for the hell of it --- assets/keymaps/experiments/.gitkeep | 0 assets/keymaps/internal.json | 1 + crates/settings/src/keymap_file.rs | 9 ++++++++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 assets/keymaps/experiments/.gitkeep create mode 100644 assets/keymaps/internal.json diff --git a/assets/keymaps/experiments/.gitkeep b/assets/keymaps/experiments/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/assets/keymaps/internal.json b/assets/keymaps/internal.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/assets/keymaps/internal.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/crates/settings/src/keymap_file.rs b/crates/settings/src/keymap_file.rs index c7cff92721..4dcb5a6fb0 100644 --- a/crates/settings/src/keymap_file.rs +++ b/crates/settings/src/keymap_file.rs @@ -42,8 +42,15 @@ struct ActionWithData(Box, Box); impl KeymapFileContent { pub fn load_defaults(cx: &mut MutableAppContext) { + let settings = cx.global::(); let mut paths = vec!["keymaps/default.json", "keymaps/vim.json"]; - paths.extend(cx.global::().experiments.keymap_files()); + + if settings.staff_mode { + paths.push("keymaps/internal.json") + } + + paths.extend(settings.experiments.keymap_files()); + for path in paths { Self::load(path, cx).unwrap(); }