Add an option to move header on borders (#9796)

A patch to play with.
Need to make a few tests after all.

The question is what shall be done with `table.mode = none`, as it has
no borders.

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


![image](https://github.com/nushell/nushell/assets/20165848/cdcffa6d-989c-4368-a436-fdf7d3400e31)

cc: @fdncred

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt
2023-08-03 22:03:20 +03:00
committed by GitHub
parent 14bf25da14
commit 7162289d77
20 changed files with 758 additions and 743 deletions

View File

@ -70,6 +70,7 @@ pub struct Config {
pub external_completer: Option<usize>,
pub filesize_metric: bool,
pub table_mode: String,
pub table_move_header: bool,
pub table_show_empty: bool,
pub use_ls_colors: bool,
pub color_config: HashMap<String, Value>,
@ -126,6 +127,7 @@ impl Default for Config {
table_index_mode: TableIndexMode::Always,
table_show_empty: true,
trim_strategy: TRIM_STRATEGY_DEFAULT,
table_move_header: false,
datetime_normal_format: None,
datetime_table_format: None,
@ -926,6 +928,9 @@ impl Value {
Value::string(config.table_mode.clone(), span);
}
}
"header_on_separator" => {
try_bool!(cols, vals, index, span, table_move_header)
}
"index_mode" => {
if let Ok(b) = value.as_string() {
let val_str = b.to_lowercase();