From ed23057ff8e01404ab608682445b4f293b6142ed Mon Sep 17 00:00:00 2001 From: Omnikar Date: Sat, 6 Nov 2021 11:57:14 -0400 Subject: Launch with defaults upon invalid config/theme (#982) * Launch with defaults upon invalid config/theme * Startup message if there is a problematic config * Statusline error if trying to switch to an invalid theme * Use serde `deny_unknown_fields` for config--- helix-term/src/config.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'helix-term/src/config.rs') diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs index 13917656..3745f871 100644 --- a/helix-term/src/config.rs +++ b/helix-term/src/config.rs @@ -3,6 +3,7 @@ use serde::Deserialize; use crate::keymap::Keymaps; #[derive(Debug, Default, Clone, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct Config { pub theme: Option, #[serde(default)] @@ -14,7 +15,7 @@ pub struct Config { } #[derive(Debug, Default, Clone, PartialEq, Deserialize)] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "kebab-case", deny_unknown_fields)] pub struct LspConfig { pub display_messages: bool, } -- cgit v1.2.3-70-g09d2