mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 11:45:50 +02:00
Give tabled a try (#5969)
* Drop in replacement from nu-table to tabled. Must act the same way as original nu-table. Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> Fix some issues Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Bump ansi-str version Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Update to latest Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Fix footer issue Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Fix header alignment Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Fix header style Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Use latest tabled/ansi-str * Refactorings Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> * Fix clippy warnings Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
@ -173,7 +173,8 @@ impl Command for Table {
|
||||
theme: load_theme_from_config(config),
|
||||
};
|
||||
|
||||
let result = nu_table::draw_table(&table, term_width, &color_hm, config);
|
||||
let result = nu_table::draw_table(&table, term_width, &color_hm, config)
|
||||
.unwrap_or_else(|| format!("Couldn't fit table into {} columns!", term_width));
|
||||
|
||||
Ok(Value::String {
|
||||
val: result,
|
||||
@ -556,7 +557,8 @@ impl Iterator for PagingTableCreator {
|
||||
|
||||
match table {
|
||||
Ok(Some(table)) => {
|
||||
let result = nu_table::draw_table(&table, term_width, &color_hm, &self.config);
|
||||
let result = nu_table::draw_table(&table, term_width, &color_hm, &self.config)
|
||||
.unwrap_or_else(|| format!("Couldn't fit table into {} columns!", term_width));
|
||||
|
||||
Some(Ok(result.as_bytes().to_vec()))
|
||||
}
|
||||
|
Reference in New Issue
Block a user