diff --git a/crates/nu-command/src/formats/to/nuon.rs b/crates/nu-command/src/formats/to/nuon.rs index 0c5bff2055..f74ab1740c 100644 --- a/crates/nu-command/src/formats/to/nuon.rs +++ b/crates/nu-command/src/formats/to/nuon.rs @@ -240,19 +240,22 @@ pub fn value_to_string( for (col, val) in cols.iter().zip(vals) { collection.push(if needs_quotes(col) { format!( - "\"{}\": {}", + "{idt_po}\"{}\": {}", col, value_to_string_without_quotes(val, span, depth + 1, indent)? ) } else { format!( - "{}: {}", + "{idt_po}{}: {}", col, 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::LazyRecord { val, .. } => { let collected = val.collect()?;