From 77f33e7b20bb84c6506d745ce05ec6835eee6756 Mon Sep 17 00:00:00 2001 From: PeepNSheep Date: Mon, 3 Oct 2022 10:45:32 -0400 Subject: Add configureable statusline mode names (#3311) * Added 'long-mode' statusline element * Added customizable statusline mode names * Removed a string clone * Added documentation * Updated documentation, moved modenames to a seperate section * Update configuration.md * Documentation update * Documentation update * Documentation update * Update configuration.md * Update configuration.md * Fixed merge error * Update configuration.md * Update configuration.md--- helix-view/src/editor.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'helix-view/src') diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index e804a864..70c49872 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -260,6 +260,7 @@ pub struct StatusLineConfig { pub center: Vec, pub right: Vec, pub separator: String, + pub mode: ModeConfig, } impl Default for StatusLineConfig { @@ -271,6 +272,25 @@ impl Default for StatusLineConfig { center: vec![], right: vec![E::Diagnostics, E::Selections, E::Position, E::FileEncoding], separator: String::from("│"), + mode: ModeConfig::default(), + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "kebab-case", default, deny_unknown_fields)] +pub struct ModeConfig { + pub normal: String, + pub insert: String, + pub select: String, +} + +impl Default for ModeConfig { + fn default() -> Self { + Self { + normal: String::from("NOR"), + insert: String::from("INS"), + select: String::from("SEL"), } } } -- cgit v1.2.3-70-g09d2