vim_mode_setting.rs

 1//! Contains the [`VimModeSetting`] and [`HelixModeSetting`] used to enable/disable Vim and Helix modes.
 2//!
 3//! This is in its own crate as we want other crates to be able to enable or
 4//! disable Vim/Helix modes without having to depend on the `vim` crate in its
 5//! entirety.
 6
 7use settings::{RegisterSetting, Settings, SettingsContent};
 8
 9#[derive(RegisterSetting)]
10pub struct VimModeSetting(pub bool);
11
12impl Settings for VimModeSetting {
13    fn from_settings(content: &SettingsContent) -> Self {
14        Self(content.vim_mode.unwrap())
15    }
16}
17
18#[derive(RegisterSetting)]
19pub struct HelixModeSetting(pub bool);
20
21impl Settings for HelixModeSetting {
22    fn from_settings(content: &SettingsContent) -> Self {
23        Self(content.helix_mode.unwrap())
24    }
25}