mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 15:04:36 +03:00
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:
parent
ec59fb6597
commit
77b6870ff3
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user