From bbd2983bbcd7fce0eae01dad4b33be458c62e163 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 16 Jul 2022 06:14:18 -0700 Subject: [PATCH] schemes: prefer name from metadata when loading toml refs: https://github.com/catppuccin/wezterm/issues/6 --- config/src/config.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/src/config.rs b/config/src/config.rs index 34f3194ba..d8c48b2ed 100644 --- a/config/src/config.rs +++ b/config/src/config.rs @@ -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!(