mirror of
https://github.com/nushell/nushell.git
synced 2025-06-19 08:26:57 +02:00
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
parent
12deff5d1b
commit
41178dff90
@ -912,8 +912,6 @@ fn convert_to_table2<'a>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (row, item) in input.clone().into_iter().enumerate() {
|
for (row, item) in input.clone().into_iter().enumerate() {
|
||||||
let row = if with_header { row + 1 } else { row };
|
|
||||||
|
|
||||||
if let Some(ctrlc) = &ctrlc {
|
if let Some(ctrlc) = &ctrlc {
|
||||||
if ctrlc.load(Ordering::SeqCst) {
|
if ctrlc.load(Ordering::SeqCst) {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
@ -935,6 +933,8 @@ fn convert_to_table2<'a>(
|
|||||||
column_width = max(column_width, width);
|
column_width = max(column_width, width);
|
||||||
|
|
||||||
let value = NuTable::create_cell(value.0, value.1);
|
let value = NuTable::create_cell(value.0, value.1);
|
||||||
|
|
||||||
|
let row = if with_header { row + 1 } else { row };
|
||||||
data[row].push(value);
|
data[row].push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ fn table_expand_0() {
|
|||||||
"╭───┬───┬───┬───────────╮\
|
"╭───┬───┬───┬───────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├───┼───┼───┼───────────┤\
|
├───┼───┼───┼───────────┤\
|
||||||
│ 1 │ 1 │ 2 │ 3 │\
|
│ 0 │ 1 │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ ╭───┬───╮ │\
|
│ 1 │ 4 │ 5 │ ╭───┬───╮ │\
|
||||||
│ │ │ │ │ 0 │ 1 │ │\
|
│ │ │ │ │ 0 │ 1 │ │\
|
||||||
│ │ │ │ │ 1 │ 2 │ │\
|
│ │ │ │ │ 1 │ 2 │ │\
|
||||||
│ │ │ │ │ 2 │ 3 │ │\
|
│ │ │ │ │ 2 │ 3 │ │\
|
||||||
@ -53,8 +53,8 @@ fn table_expand_exeed_overlap_0() {
|
|||||||
"╭───┬────────────────────────┬───┬───────────╮\
|
"╭───┬────────────────────────┬───┬───────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├───┼────────────────────────┼───┼───────────┤\
|
├───┼────────────────────────┼───┼───────────┤\
|
||||||
│ 1 │ xxxxxxxxxxxxxxxxxxxxxx │ 2 │ 3 │\
|
│ 0 │ xxxxxxxxxxxxxxxxxxxxxx │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ ╭───┬───╮ │\
|
│ 1 │ 4 │ 5 │ ╭───┬───╮ │\
|
||||||
│ │ │ │ │ 0 │ 1 │ │\
|
│ │ │ │ │ 0 │ 1 │ │\
|
||||||
│ │ │ │ │ 1 │ 2 │ │\
|
│ │ │ │ │ 1 │ 2 │ │\
|
||||||
│ │ │ │ │ 2 │ 3 │ │\
|
│ │ │ │ │ 2 │ 3 │ │\
|
||||||
@ -73,8 +73,8 @@ fn table_expand_exeed_overlap_0() {
|
|||||||
"╭──────┬───────────────────────────────────────────────────┬─────┬─────────────╮\
|
"╭──────┬───────────────────────────────────────────────────┬─────┬─────────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├──────┼───────────────────────────────────────────────────┼─────┼─────────────┤\
|
├──────┼───────────────────────────────────────────────────┼─────┼─────────────┤\
|
||||||
│ 1 │ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx │ 2 │ 3 │\
|
│ 0 │ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ ╭───┬───╮ │\
|
│ 1 │ 4 │ 5 │ ╭───┬───╮ │\
|
||||||
│ │ │ │ │ 0 │ 1 │ │\
|
│ │ │ │ │ 0 │ 1 │ │\
|
||||||
│ │ │ │ │ 1 │ 2 │ │\
|
│ │ │ │ │ 1 │ 2 │ │\
|
||||||
│ │ │ │ │ 2 │ 3 │ │\
|
│ │ │ │ │ 2 │ 3 │ │\
|
||||||
@ -91,8 +91,8 @@ fn table_expand_deep_0() {
|
|||||||
"╭───┬───┬───┬────────────────────────╮\
|
"╭───┬───┬───┬────────────────────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├───┼───┼───┼────────────────────────┤\
|
├───┼───┼───┼────────────────────────┤\
|
||||||
│ 1 │ 1 │ 2 │ 3 │\
|
│ 0 │ 1 │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ ╭───┬────────────────╮ │\
|
│ 1 │ 4 │ 5 │ ╭───┬────────────────╮ │\
|
||||||
│ │ │ │ │ 0 │ 1 │ │\
|
│ │ │ │ │ 0 │ 1 │ │\
|
||||||
│ │ │ │ │ 1 │ 2 │ │\
|
│ │ │ │ │ 1 │ 2 │ │\
|
||||||
│ │ │ │ │ 2 │ [list 3 items] │ │\
|
│ │ │ │ │ 2 │ [list 3 items] │ │\
|
||||||
@ -109,8 +109,8 @@ fn table_expand_deep_1() {
|
|||||||
"╭───┬───┬───┬────────────────╮\
|
"╭───┬───┬───┬────────────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├───┼───┼───┼────────────────┤\
|
├───┼───┼───┼────────────────┤\
|
||||||
│ 1 │ 1 │ 2 │ 3 │\
|
│ 0 │ 1 │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ [list 3 items] │\
|
│ 1 │ 4 │ 5 │ [list 3 items] │\
|
||||||
╰───┴───┴───┴────────────────╯"
|
╰───┴───┴───┴────────────────╯"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -123,8 +123,8 @@ fn table_expand_flatten_0() {
|
|||||||
"╭───┬───┬───┬───────────────╮\
|
"╭───┬───┬───┬───────────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├───┼───┼───┼───────────────┤\
|
├───┼───┼───┼───────────────┤\
|
||||||
│ 1 │ 1 │ 2 │ 3 │\
|
│ 0 │ 1 │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ ╭───┬───────╮ │\
|
│ 1 │ 4 │ 5 │ ╭───┬───────╮ │\
|
||||||
│ │ │ │ │ 0 │ 1 │ │\
|
│ │ │ │ │ 0 │ 1 │ │\
|
||||||
│ │ │ │ │ 1 │ 2 │ │\
|
│ │ │ │ │ 1 │ 2 │ │\
|
||||||
│ │ │ │ │ 2 │ 1 1 1 │ │\
|
│ │ │ │ │ 2 │ 1 1 1 │ │\
|
||||||
@ -143,8 +143,8 @@ fn table_expand_flatten_1() {
|
|||||||
"╭───┬───┬───┬───────────────╮\
|
"╭───┬───┬───┬───────────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├───┼───┼───┼───────────────┤\
|
├───┼───┼───┼───────────────┤\
|
||||||
│ 1 │ 1 │ 2 │ 3 │\
|
│ 0 │ 1 │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ ╭───┬───────╮ │\
|
│ 1 │ 4 │ 5 │ ╭───┬───────╮ │\
|
||||||
│ │ │ │ │ 0 │ 1 │ │\
|
│ │ │ │ │ 0 │ 1 │ │\
|
||||||
│ │ │ │ │ 1 │ 2 │ │\
|
│ │ │ │ │ 1 │ 2 │ │\
|
||||||
│ │ │ │ │ 2 │ 1,1,1 │ │\
|
│ │ │ │ │ 2 │ 1,1,1 │ │\
|
||||||
@ -164,8 +164,8 @@ fn table_expand_flatten_and_deep_1() {
|
|||||||
"╭───┬───┬───┬────────────────────────────────╮\
|
"╭───┬───┬───┬────────────────────────────────╮\
|
||||||
│ # │ a │ b │ c │\
|
│ # │ a │ b │ c │\
|
||||||
├───┼───┼───┼────────────────────────────────┤\
|
├───┼───┼───┼────────────────────────────────┤\
|
||||||
│ 1 │ 1 │ 2 │ 3 │\
|
│ 0 │ 1 │ 2 │ 3 │\
|
||||||
│ 2 │ 4 │ 5 │ ╭───┬────────────────────────╮ │\
|
│ 1 │ 4 │ 5 │ ╭───┬────────────────────────╮ │\
|
||||||
│ │ │ │ │ 0 │ 1 │ │\
|
│ │ │ │ │ 0 │ 1 │ │\
|
||||||
│ │ │ │ │ 1 │ 2 │ │\
|
│ │ │ │ │ 1 │ 2 │ │\
|
||||||
│ │ │ │ │ 2 │ ╭───┬────────────────╮ │ │\
|
│ │ │ │ │ 2 │ ╭───┬────────────────╮ │ │\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user