@@ -268,18 +268,29 @@ impl ThemePalette {
269 .as_str()
269 .as_str()
270 .and_then(|s| s.parse().ok())
270 .and_then(|s| s.parse().ok())
271− .ok_or(format!("Theme: invalid underline-style: {}", value))
271+ .ok_or(format!("Theme: invalid underline style: {}", value))
274 pub fn parse_style(&self, style: &mut Style, value: Value) -> Result<(), String> {
274 pub fn parse_style(&self, style: &mut Style, value: Value) -> Result<(), String> {
275 if let Value::Table(entries) = value {
275 if let Value::Table(entries) = value {
276− for (name, value) in entries {
276+ for (name, mut value) in entries {
277 match name.as_str() {
277 match name.as_str() {
278 "fg" => *style = style.fg(self.parse_color(value)?),
278 "fg" => *style = style.fg(self.parse_color(value)?),
279 "bg" => *style = style.bg(self.parse_color(value)?),
279 "bg" => *style = style.bg(self.parse_color(value)?),
283+ .ok_or("Theme: underline must be table")?;
284+ if let Some(value) = table.remove("color") {
280− "underline-color" => *style = style.underline_color(self.parse_color(value)?),
285+ *style = style.underline_color(self.parse_color(value)?);
281− "underline-style" => {
286+ }
287+ if let Some(value) = table.remove("style") {
282− *style = style.underline_style(Self::parse_underline_style(&value)?)
288+ *style = style.underline_style(Self::parse_underline_style(&value)?);
291+ if let Some(attr) = table.keys().next() {
292+ return Err(format!("Theme: invalid underline attribute: {attr}"));
284 "modifiers" => {
295 "modifiers" => {
285 let modifiers = value
296 let modifiers = value