nu-table/ Bump tabled version (#6097)

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt
2022-07-22 18:33:29 +03:00
committed by GitHub
parent c66b97126f
commit 453c11b4b5
3 changed files with 22 additions and 18 deletions

View File

@ -16,4 +16,4 @@ nu-ansi-term = "0.46.0"
nu-protocol = { path = "../nu-protocol", version = "0.65.1" }
strip-ansi-escapes = "0.1.1"
atty = "0.2.14"
tabled = { git = "https://github.com/zhiburt/tabled", rev = "f24b945bdd3a1152d52561b70b0c88c2581ac5ff", features = ["color"] }
tabled = { version = "0.8.0", features = ["color"] }

View File

@ -7,7 +7,7 @@ use tabled::{
formatting_settings::AlignmentStrategy,
object::{Cell, Columns, Rows, Segment},
papergrid,
style::BorderColor,
style::Color,
Alignment, AlignmentHorizontal, Modify, ModifyObject, TableOption, Width,
};
@ -205,20 +205,20 @@ fn align_table(
.with(AlignmentStrategy::PerLine),
);
if with_header {
let alignment = Alignment::Horizontal(alignments.header);
if with_footer {
table = table.with(Modify::new(Rows::last()).with(alignment.clone()));
}
table = table.with(Modify::new(Rows::first()).with(alignment));
}
if with_index {
table =
table.with(Modify::new(Columns::first()).with(Alignment::Horizontal(alignments.index)));
}
if with_header {
let alignment = Alignment::Horizontal(alignments.header);
table = table.with(Modify::new(Rows::first()).with(alignment.clone()));
if with_footer {
table = table.with(Modify::new(Rows::last()).with(alignment));
}
}
table = override_alignments(table, data, with_header, with_index, alignments);
table
@ -269,7 +269,7 @@ fn load_theme(
if let Some(color) = color_hm.get("separator") {
let color = color.paint(" ").to_string();
if let Ok(color) = BorderColor::try_from(color) {
if let Ok(color) = Color::try_from(color) {
table = table.with(color);
}
}