diff options
-rw-r--r-- | helix-term/src/commands/typed.rs | 2 | ||||
-rw-r--r-- | helix-view/src/theme.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 2119a48d..cb387fcb 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -777,7 +777,7 @@ fn theme( .editor .theme_loader .load(theme_name) - .with_context(|| "Theme does not exist")?; + .map_err(|err| anyhow::anyhow!("Could not load theme: {}", err))?; if !(true_color || theme.is_16_color()) { bail!("Unsupported theme: theme requires true color support"); } diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs index f1219ec5..b2c8a79f 100644 --- a/helix-view/src/theme.rs +++ b/helix-view/src/theme.rs @@ -136,8 +136,9 @@ impl Loader { // Loads the theme data as `toml::Value` first from the user_dir then in default_dir fn load_toml(&self, path: PathBuf) -> Result<Value> { let data = std::fs::read(&path)?; + let value = toml::from_slice(data.as_slice())?; - toml::from_slice(data.as_slice()).context("Failed to deserialize theme") + Ok(value) } // Returns the path to the theme with the name |