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

@ -38,7 +38,7 @@ use std::{
use terminal_view::{get_working_directory, TerminalView};
use fs::RealFs;
use settings::watched_json::{watch_keymap_file, watch_settings_file, WatchedJsonFile};
use settings::watched_json::WatchedJsonFile;
use theme::ThemeRegistry;
#[cfg(debug_assertions)]
use util::StaffMode;
@ -123,7 +123,14 @@ fn main() {
fs.clone(),
));
watch_settings_file(default_settings, settings_file_content, themes.clone(), cx);
settings::watch_files(
default_settings,
settings_file_content,
themes.clone(),
keymap_file,
cx,
);
if !stdout_is_a_pty() {
upload_previous_panics(http.clone(), cx);
}
@ -136,8 +143,6 @@ fn main() {
languages::init(languages.clone());
let user_store = cx.add_model(|cx| UserStore::new(client.clone(), http.clone(), cx));
watch_keymap_file(keymap_file, cx);
cx.set_global(client.clone());
context_menu::init(cx);

View file

@ -21,7 +21,7 @@ use gpui::{
geometry::vector::vec2f,
impl_actions,
platform::{WindowBounds, WindowOptions},
AssetSource, Platform, PromptLevel, TitlebarOptions, ViewContext, WindowKind,
AssetSource, Platform, PromptLevel, TitlebarOptions, ViewContext, WindowKind,
};
use language::Rope;
pub use lsp;
@ -144,8 +144,12 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
});
});
cx.add_global_action(move |_: &install_cli::Install, cx| {
cx.spawn(|cx| async move { install_cli::install_cli(&cx).await.context("error creating CLI symlink") })
.detach_and_log_err(cx);
cx.spawn(|cx| async move {
install_cli::install_cli(&cx)
.await
.context("error creating CLI symlink")
})
.detach_and_log_err(cx);
});
cx.add_action({
let app_state = app_state.clone();