1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

schemes: prefer name from metadata when loading toml

refs: https://github.com/catppuccin/wezterm/issues/6
This commit is contained in:
Wez Furlong 2022-07-16 06:14:18 -07:00
parent 73993a60b4
commit bbd2983bbc

View File

@ -1056,13 +1056,16 @@ impl Config {
let path = entry.path(); let path = entry.path();
match load_scheme(&path) { match load_scheme(&path) {
Ok(scheme) => { Ok(scheme) => {
let name = scheme
.metadata
.name
.unwrap_or_else(|| scheme_name.to_string());
log::trace!( log::trace!(
"Loaded color scheme `{}` from {}", "Loaded color scheme `{}` from {}",
scheme_name, name,
path.display() path.display()
); );
self.color_schemes self.color_schemes.insert(name, scheme.colors);
.insert(scheme_name.to_string(), scheme.colors);
} }
Err(err) => { Err(err) => {
log::error!( log::error!(