mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Fix vim toggle on welcome
This commit is contained in:
parent
a9349267ec
commit
1a86e4ff96
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -11423,6 +11423,7 @@ dependencies = [
|
||||
"theme_selector2",
|
||||
"ui2",
|
||||
"util",
|
||||
"vim2",
|
||||
"workspace2",
|
||||
]
|
||||
|
||||
|
@ -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 = true
|
||||
log.workspace = true
|
||||
|
@ -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")),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user