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.
This commit is contained in:
Wez Furlong committed 2022-07-19 12:02:23 -07:00
1 parent ec59fb6597
commit 77b6870ff3
1 file changed
+1 -12
+1 -12
View File
@@ -495,18 +495,7 @@ impl ColorSchemeFile {
pub fn from_toml_str(s: &str) -> anyhow::Result<Self> {
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<toml::Value> {