add heavy & none table border options (#2686)

This commit is contained in:
Darren Schroeder 2020-10-21 08:53:08 -05:00 committed by GitHub
parent db590369a8
commit 1eb28c6cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 0 deletions

View File

@ -59,6 +59,8 @@ pub fn table_mode(config: &NuConfig) -> nu_table::Theme {
Ok(m) if m == "compact_double" => nu_table::Theme::compact_double(),
Ok(m) if m == "rounded" => nu_table::Theme::rounded(),
Ok(m) if m == "reinforced" => nu_table::Theme::reinforced(),
Ok(m) if m == "heavy" => nu_table::Theme::heavy(),
Ok(m) if m == "none" => nu_table::Theme::none(),
_ => nu_table::Theme::compact(),
})
}

View File

@ -536,6 +536,66 @@ impl Theme {
print_bottom_border: true,
}
}
#[allow(unused)]
pub fn heavy() -> Theme {
Theme {
top_left: '',
middle_left: '',
bottom_left: '',
top_center: '',
center: '',
bottom_center: '',
top_right: '',
middle_right: '',
bottom_right: '',
top_horizontal: '',
middle_horizontal: '',
bottom_horizontal: '',
left_vertical: '',
center_vertical: '',
right_vertical: '',
separate_header: true,
separate_rows: false,
print_left_border: true,
print_right_border: true,
print_top_border: true,
print_bottom_border: true,
}
}
#[allow(unused)]
pub fn none() -> Theme {
Theme {
top_left: ' ',
middle_left: ' ',
bottom_left: ' ',
top_center: ' ',
center: ' ',
bottom_center: ' ',
top_right: ' ',
middle_right: ' ',
bottom_right: ' ',
top_horizontal: ' ',
middle_horizontal: ' ',
bottom_horizontal: ' ',
left_vertical: ' ',
center_vertical: ' ',
right_vertical: ' ',
separate_header: false,
separate_rows: false,
print_left_border: false,
print_right_border: false,
print_top_border: false,
print_bottom_border: false,
}
}
}
impl Table {