mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 01:05:01 +02:00
nu-table: Fix header style (again 2x) (#6073)
* nu-table: Fix header style It did appeared again after my small change... Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * nu-table: Add a empty header style test Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
@ -257,7 +257,12 @@ fn load_theme(
|
||||
with_footer: bool,
|
||||
with_header: bool,
|
||||
) -> tabled::Table {
|
||||
table = table.with(theme.theme.clone());
|
||||
let mut theme = theme.theme.clone();
|
||||
if !with_header {
|
||||
theme.set_lines(HashMap::default());
|
||||
}
|
||||
|
||||
table = table.with(theme);
|
||||
|
||||
if let Some(color) = color_hm.get("separator") {
|
||||
let color = color.paint(" ").to_string();
|
||||
@ -274,10 +279,6 @@ fn load_theme(
|
||||
);
|
||||
}
|
||||
|
||||
if !with_header {
|
||||
table = table.with(RemoveHeaderLine);
|
||||
}
|
||||
|
||||
table
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use tabled::{papergrid::Line, style::RawStyle, Style};
|
||||
use tabled::style::{Line, RawStyle, Style};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TableTheme {
|
||||
@ -20,7 +20,9 @@ impl TableTheme {
|
||||
|
||||
pub fn light() -> TableTheme {
|
||||
Self {
|
||||
theme: Style::blank().lines([(1, Line::short('─', '─'))]).into(),
|
||||
theme: Style::blank()
|
||||
.lines([(1, Line::new(Some('─'), Some('─'), None, None))])
|
||||
.into(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +43,7 @@ impl TableTheme {
|
||||
.top('❤')
|
||||
.bottom('❤')
|
||||
.vertical('❤')
|
||||
.lines([(1, Line::short('❤', '❤'))])
|
||||
.lines([(1, Line::new(Some('❤'), Some('❤'), None, None))])
|
||||
.into(),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user