aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/config.rs
diff options
context:
space:
mode:
authorwojciechkepka2021-06-20 19:31:45 +0000
committerBlaž Hrastnik2021-06-21 03:59:06 +0000
commitcc357d50964ecd5760f1367a8a7b63fd45a0f1ce (patch)
tree5a6787d955cf3c990e029aeb5845a6e3f18e5577 /helix-term/src/config.rs
parentb2804b14b13c511cbf9c3bba88e1687a0d0908a8 (diff)
Add progress spinners to status line
Diffstat (limited to 'helix-term/src/config.rs')
-rw-r--r--helix-term/src/config.rs33
1 files changed, 12 insertions, 21 deletions
diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs
index 2c95fae3..839235f1 100644
--- a/helix-term/src/config.rs
+++ b/helix-term/src/config.rs
@@ -1,35 +1,28 @@
use anyhow::{Error, Result};
-use std::{collections::HashMap, str::FromStr};
+use std::collections::HashMap;
use serde::{de::Error as SerdeError, Deserialize, Serialize};
use crate::keymap::{parse_keymaps, Keymaps};
-pub struct GlobalConfig {
- pub theme: Option<String>,
- pub lsp_progress: bool,
-}
-
-impl Default for GlobalConfig {
- fn default() -> Self {
- Self {
- lsp_progress: true,
- theme: None,
- }
- }
-}
-
#[derive(Default)]
pub struct Config {
- pub global: GlobalConfig,
+ pub theme: Option<String>,
+ pub lsp: LspConfig,
pub keymaps: Keymaps,
}
+#[derive(Default, Serialize, Deserialize)]
+pub struct LspConfig {
+ pub display_messages: bool,
+}
+
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
struct TomlConfig {
theme: Option<String>,
- lsp_progress: Option<bool>,
+ #[serde(default)]
+ lsp: LspConfig,
keys: Option<HashMap<String, HashMap<String, String>>>,
}
@@ -40,10 +33,8 @@ impl<'de> Deserialize<'de> for Config {
{
let config = TomlConfig::deserialize(deserializer)?;
Ok(Self {
- global: GlobalConfig {
- lsp_progress: config.lsp_progress.unwrap_or(true),
- theme: config.theme,
- },
+ theme: config.theme,
+ lsp: config.lsp,
keymaps: config
.keys
.map(|r| parse_keymaps(&r))