From ad73c947600a3b881950429f1389f9a8dfd1b66a Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 11 Mar 2023 11:34:49 +0100 Subject: [PATCH] do the regular lists --- crates/nu-command/src/formats/to/nuon.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/nu-command/src/formats/to/nuon.rs b/crates/nu-command/src/formats/to/nuon.rs index f70e17b22b..eb932eb88b 100644 --- a/crates/nu-command/src/formats/to/nuon.rs +++ b/crates/nu-command/src/formats/to/nuon.rs @@ -211,14 +211,16 @@ pub fn value_to_string( } else { let mut collection = vec![]; for val in vals { - collection.push(value_to_string_without_quotes( - val, - span, - depth + 1, - indent, - )?); + collection.push(format!( + "{}{}", + get_true_indentation(depth + 1, indent), + value_to_string_without_quotes(val, span, depth + 1, indent,)? + )); } - Ok(format!("[{}]", collection.join(", "))) + Ok(format!( + "[{nl}{}{nl}{idt}]", + collection.join(&format!(", {nl}").to_string()) + )) } } Value::Nothing { .. } => Ok("null".to_string()),