Introduce footer_inheritance option (#14070)

```nu
$env.config.table.footer_inheritance = true
```

close #14060
This commit is contained in:
Maxim Zhiburt
2024-10-23 20:45:47 +03:00
committed by GitHub
parent 619211c1bf
commit 3ec1c40320
8 changed files with 222 additions and 67 deletions

View File

@ -333,6 +333,7 @@ pub struct TableConfig {
pub trim: TrimStrategy,
pub header_on_separator: bool,
pub abbreviated_row_count: Option<usize>,
pub footer_inheritance: bool,
}
impl IntoValue for TableConfig {
@ -350,6 +351,7 @@ impl IntoValue for TableConfig {
"trim" => self.trim.into_value(span),
"header_on_separator" => self.header_on_separator.into_value(span),
"abbreviated_row_count" => abbv_count,
"footer_inheritance" => self.footer_inheritance.into_value(span),
}
.into_value(span)
}
@ -365,6 +367,7 @@ impl Default for TableConfig {
header_on_separator: false,
padding: TableIndent::default(),
abbreviated_row_count: None,
footer_inheritance: false,
}
}
}
@ -401,6 +404,7 @@ impl UpdateFromValue for TableConfig {
}
_ => errors.type_mismatch(path, Type::custom("int or nothing"), val),
},
"footer_inheritance" => self.footer_inheritance.update(val, path, errors),
_ => errors.unknown_option(path, val),
}
}