Files
oak-gpui/crates/vim_mode_setting/src/vim_mode_setting.rs
T
Mikayla MakiandNia 5f8226457e Automate settings registration (#42238)
Release Notes:

- N/A

---------

Co-authored-by: Nia <nia@zed.dev>
2025-11-07 22:27:14 +00:00

26 lines
760 B
Rust

//! Contains the [`VimModeSetting`] and [`HelixModeSetting`] used to enable/disable Vim and Helix modes.
//!
//! This is in its own crate as we want other crates to be able to enable or
//! disable Vim/Helix modes without having to depend on the `vim` crate in its
//! entirety.
use settings::{RegisterSetting, Settings, SettingsContent};
#[derive(RegisterSetting)]
pub struct VimModeSetting(pub bool);
impl Settings for VimModeSetting {
fn from_settings(content: &SettingsContent) -> Self {
Self(content.vim_mode.unwrap())
}
}
#[derive(RegisterSetting)]
pub struct HelixModeSetting(pub bool);
impl Settings for HelixModeSetting {
fn from_settings(content: &SettingsContent) -> Self {
Self(content.helix_mode.unwrap())
}
}