mirror of
https://github.com/nushell/nushell.git
synced 2025-08-11 13:34:49 +02:00
Bump tabled
dependency to 0.11 (#8922)
close? #8060 Quite a bit of refactoring took place. I believe a few improvements to collapse/expand were made. I've tried to track any performance regressions and seems like it is fine. I've noticed something different now with default configuration path or something in this regard? So I might missed something while testing because of this. Requires some oversight. --------- Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
use tabled::{builder::Builder, object::Cell, Modify, Padding, Style, Width};
|
||||
use tabled::{
|
||||
builder::Builder,
|
||||
grid::util::string::string_width_multiline,
|
||||
settings::{width::Truncate, Modify, Padding, Style, Width},
|
||||
};
|
||||
|
||||
pub fn string_width(text: &str) -> usize {
|
||||
tabled::papergrid::util::string_width_multiline_tab(text, 4)
|
||||
string_width_multiline(text)
|
||||
}
|
||||
|
||||
pub fn string_wrap(text: &str, width: usize, keep_words: bool) -> String {
|
||||
@ -24,7 +28,7 @@ pub fn string_wrap(text: &str, width: usize, keep_words: bool) -> String {
|
||||
.build()
|
||||
.with(Style::empty())
|
||||
.with(Padding::zero())
|
||||
.with(Modify::new(Cell(0, 0)).with(wrap))
|
||||
.with(Modify::new((0, 0)).with(wrap))
|
||||
.to_string()
|
||||
}
|
||||
|
||||
@ -36,10 +40,5 @@ pub fn string_truncate(text: &str, width: usize) -> String {
|
||||
None => return String::new(),
|
||||
};
|
||||
|
||||
Builder::from_iter([[line]])
|
||||
.build()
|
||||
.with(Style::empty())
|
||||
.with(Padding::zero())
|
||||
.with(Width::truncate(width))
|
||||
.to_string()
|
||||
Truncate::truncate_text(line, width).into_owned()
|
||||
}
|
||||
|
Reference in New Issue
Block a user