mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 14:36:08 +02:00
Bump tabled to 0.17 (#14415)
With this comes a new `unicode-width` as I remember there was some issue with `ratatui`. And a bit of refactorings which are ment to reduce code lines while not breaking anything. Not yet complete, I think I'll try to improve some more places, just wanted to trigger CI 😄 And yessssssssss we have a new `unicode-width` but I sort of doubtful, I mean the original issue with emojie. I think it may require an additional "clean" call. I am just saying I was not testing it with that case of complex emojies. --------- Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
@ -1,14 +1,17 @@
|
||||
use crate::debug::inspect_table::{
|
||||
global_horizontal_char::SetHorizontalChar, set_widths::SetWidths,
|
||||
};
|
||||
// note: Seems like could be simplified
|
||||
// IMHO: it shall not take 300+ lines :)
|
||||
|
||||
use nu_protocol::Value;
|
||||
use nu_table::{string_width, string_wrap};
|
||||
|
||||
use tabled::{
|
||||
grid::config::ColoredConfig,
|
||||
settings::{peaker::PriorityMax, width::Wrap, Settings, Style},
|
||||
settings::{peaker::Priority, width::Wrap, Settings, Style},
|
||||
Table,
|
||||
};
|
||||
|
||||
use self::{global_horizontal_char::SetHorizontalChar, set_widths::SetWidths};
|
||||
|
||||
pub fn build_table(value: Value, description: String, termsize: usize) -> String {
|
||||
let (head, mut data) = util::collect_input(value);
|
||||
let count_columns = head.len();
|
||||
@ -57,7 +60,7 @@ pub fn build_table(value: Value, description: String, termsize: usize) -> String
|
||||
Settings::default()
|
||||
.with(Style::rounded().corner_top_left('├').corner_top_right('┤'))
|
||||
.with(SetWidths(widths))
|
||||
.with(Wrap::new(width).priority(PriorityMax))
|
||||
.with(Wrap::new(width).priority(Priority::max(true)))
|
||||
.with(SetHorizontalChar::new('┼', '┴', 11 + 2 + 1)),
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user