Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix vim toggle on welcome
Conrad Irwin1a86e4ff962a
diff --git a/Cargo.lock b/Cargo.lockindex 86ae29e16b5..8457edcd3ec 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -11423,6 +11423,7 @@ dependencies = ["theme_selector2","ui2","util",+ "vim2","workspace2",]diff --git a/crates/welcome2/Cargo.toml b/crates/welcome2/Cargo.tomlindex ce2e102ca09..e45af11e023 100644--- a/crates/welcome2/Cargo.toml+++ b/crates/welcome2/Cargo.toml@@ -26,7 +26,7 @@ theme_selector = { package = "theme_selector2", path = "../theme_selector2" }util = { path = "../util" }picker = { package = "picker2", path = "../picker2" }workspace = { package = "workspace2", path = "../workspace2" }-# vim = { package = "vim2", path = "../vim2" }+vim = { package = "vim2", path = "../vim2" }anyhow.workspace = truelog.workspace = truediff --git a/crates/welcome2/src/welcome.rs b/crates/welcome2/src/welcome.rsindex 429f292edc8..c553a04fc7b 100644--- a/crates/welcome2/src/welcome.rs+++ b/crates/welcome2/src/welcome.rs@@ -11,6 +11,7 @@ use gpui::{use settings::{Settings, SettingsStore};use std::sync::Arc;use ui::{prelude::*, Checkbox};+use vim::VimModeSetting;use workspace::{dock::DockPosition,item::{Item, ItemEvent},@@ -128,29 +129,26 @@ impl Render for WelcomePage {.border_color(cx.theme().colors().border).rounded_md().child(- // todo!("vim setting")h_stack().gap_2().child(Checkbox::new("enable-vim",- if false- /* VimSettings::get_global(cx).enabled */- {+ if VimModeSetting::get_global(cx).0 {ui::Selection::Selected} else {ui::Selection::Unselected},- ),- // .on_click(cx.listener(- // move |this, selection, cx| {- // this.update_settings::<VimSettings>(- // selection,- // cx,- // |settings, value| settings.enabled = value,- // );- // },- // )),+ )+ .on_click(cx.listener(+ move |this, selection, cx| {+ this.update_settings::<VimModeSetting>(+ selection,+ cx,+ |setting, value| *setting = Some(value),+ );+ },+ )),).child(Label::new("Enable vim mode")),)