aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorPeepNSheep2022-10-03 14:45:32 +0000
committerGitHub2022-10-03 14:45:32 +0000
commit77f33e7b20bb84c6506d745ce05ec6835eee6756 (patch)
tree198c0063a53ff7c919d12d2662438d9573dd4a15 /helix-view/src
parent589d17c7583716b339875b72972aaffe0ae5efc1 (diff)
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
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/editor.rs20
1 files changed, 20 insertions, 0 deletions
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<StatusLineElement>,
pub right: Vec<StatusLineElement>,
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"),
}
}
}