schemes: prefer name from metadata when loading toml

refs: https://github.com/catppuccin/wezterm/issues/6
This commit is contained in:
Wez Furlong committed 2022-07-16 06:14:18 -07:00
1 parent 73993a60b4
commit bbd2983bbc
1 file changed
+6 -3
+6 -3
View File
@@ -1056,13 +1056,16 @@ impl Config {
let path = entry.path();
match load_scheme(&path) {
Ok(scheme) => {
let name = scheme
.metadata
.name
.unwrap_or_else(|| scheme_name.to_string());
log::trace!(
"Loaded color scheme `{}` from {}",
scheme_name,
name,
path.display()
);
self.color_schemes
.insert(scheme_name.to_string(), scheme.colors);
self.color_schemes.insert(name, scheme.colors);
}
Err(err) => {
log::error!(