Repository: zellij-org/zellij (language: rust)

Issue:
Bug: no error output for missing theme colors when themes is not a section in config file
# Summary

Theme error reporting works with this structure:
```
.config
    └── zellij
        └── config.kdl    <-- themes section in this file
```
But it does not work with this structure
```
.config
    └── zellij
        ├── config.kdl
        └── themes
            └── themes.kdl    <-- themes section in this file
```

## Basic information

`zellij --version`: zellij 0.38.0

## Further information

### Reproduction steps

1. Create a theme with a missing theme color in the themes config directory
2. Run zellij

### Noticeable behavior

* If the themes section is inside the config file, zellij outputs the miette fancy-formatted error when using a theme with a missing theme color .

<details>
<summary>Output</summary>

```
   × Failed to parse Zellij configuration
     ╭─[/home/user/.config/zellij/config.kdl:140:1]
 140 │     themes {
 141 │ ╭─▶     default {
 142 │ │           fg "#ffffff" 
 143 │ │           bg "#ffffff" 
 144 │ │           black "#ffffff"
 145 │ │           red "#ffffff"
 146 │ │           green "#ffffff"
 147 │ │           yellow "#ffffff"
 148 │ │           blue "#ffffff"
 149 │ │           magenta "#ffffff"
 150 │ │           cyan "#ffffff" 
 151 │ ├─▶         white "#ffffff" 
     · ╰──── Missing theme color: orange
 152 │         }
 153 │     }
     ╰────
  help: For more information, please see our configuration guide: https://
        zellij.dev/documentation/configuration.html
```

</details>

* If the themes section is stored in a themes subdirectory, zellij does not output the miette fancy-formatted error when using a theme with a missing theme color .

<details>
<summary>Output</summary>

```
  × Failed to parse Zellij configuration
  help: For more information, please see our configuration guide: https://
        zellij.dev/documentation/configuration.html
```

</details>


Discussion / hints:

Fix patch:
diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs
index a7573af55a..10f8ad89dd 100644
--- a/zellij-utils/src/kdl/mod.rs
+++ b/zellij-utils/src/kdl/mod.rs
@@ -1782,7 +1782,7 @@ impl Themes {
         Ok(themes)
     }
 
-    pub fn from_string(raw_string: String) -> Result<Self, ConfigError> {
+    pub fn from_string(raw_string: &String) -> Result<Self, ConfigError> {
         let kdl_config: KdlDocument = raw_string.parse()?;
         let kdl_themes = kdl_config.get("themes").ok_or(ConfigError::new_kdl_error(
             "No theme node found in file".into(),
@@ -1796,8 +1796,13 @@ impl Themes {
     pub fn from_path(path_to_theme_file: PathBuf) -> Result<Self, ConfigError> {
         // String is the theme name
         let kdl_config = std::fs::read_to_string(&path_to_theme_file)
-            .map_err(|e| ConfigError::IoPath(e, path_to_theme_file.into()))?;
-        Themes::from_string(kdl_config)
+            .map_err(|e| ConfigError::IoPath(e, path_to_theme_file.clone()))?;
+        Themes::from_string(&kdl_config).map_err(|e| match e {
+            ConfigError::KdlError(kdl_error) => ConfigError::KdlError(
+                kdl_error.add_src(path_to_theme_file.display().to_string(), kdl_config),
+            ),
+            e => e,
+        })
     }
 
     pub fn from_dir(path_to_theme_dir: PathBuf) -> Result<Self, ConfigError> {
diff --git a/zellij-utils/src/setup.rs b/zellij-utils/src/setup.rs
index 44fed5fa80..09009a85bd 100644
--- a/zellij-utils/src/setup.rs
+++ b/zellij-utils/src/setup.rs
@@ -68,7 +68,7 @@ fn get_default_themes() -> Themes {
     let mut themes = Themes::default();
     for file in ZELLIJ_DEFAULT_THEMES.files() {
         if let Some(content) = file.contents_utf8() {
-            match Themes::from_string(content.to_string()) {
+            match Themes::from_string(&content.to_string()) {
                 Ok(theme) => themes = themes.merge(theme),
                 Err(_) => {},
             }


Test patch: