From 77b6870ff397d8a4fed7399e25b5fc3f80ebfd6d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 19 Jul 2022 12:00:49 -0700 Subject: [PATCH] config: revert taking name from the first comment line of toml color scheme files I needed this while swinging through to the new color scheme data stuff, but I don't need it any more, and it causes problems with external toml files. --- config/src/color.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/config/src/color.rs b/config/src/color.rs index 7259d6290..422aa37de 100644 --- a/config/src/color.rs +++ b/config/src/color.rs @@ -495,18 +495,7 @@ impl ColorSchemeFile { pub fn from_toml_str(s: &str) -> anyhow::Result { let scheme: toml::Value = toml::from_str(s)?; - let mut scheme = ColorSchemeFile::from_toml_value(&scheme)?; - - // Little hack to extract comment style metadata from - // iTerm2-Color-Schemes generated toml files - if scheme.metadata.name.is_none() { - if let Some(first_line) = s.lines().next() { - if let Some(name) = first_line.strip_prefix("# ") { - scheme.metadata.name.replace(name.to_string()); - } - } - } - Ok(scheme) + Self::from_toml_value(&scheme) } pub fn to_toml_value(&self) -> anyhow::Result {