mirror of
https://github.com/nushell/nushell.git
synced 2025-06-05 09:36:44 +02:00
computate the indentation +1 level once
This commit is contained in:
parent
ad73c94760
commit
496d45cffa
@ -102,6 +102,7 @@ pub fn value_to_string(
|
|||||||
) -> Result<String, ShellError> {
|
) -> Result<String, ShellError> {
|
||||||
let nl = get_true_newline(indent);
|
let nl = get_true_newline(indent);
|
||||||
let idt = get_true_indentation(depth, indent);
|
let idt = get_true_indentation(depth, indent);
|
||||||
|
let idt_po = get_true_indentation(depth + 1, indent);
|
||||||
|
|
||||||
match v {
|
match v {
|
||||||
Value::Binary { val, .. } => {
|
Value::Binary { val, .. } => {
|
||||||
@ -212,8 +213,7 @@ pub fn value_to_string(
|
|||||||
let mut collection = vec![];
|
let mut collection = vec![];
|
||||||
for val in vals {
|
for val in vals {
|
||||||
collection.push(format!(
|
collection.push(format!(
|
||||||
"{}{}",
|
"{idt_po}{}",
|
||||||
get_true_indentation(depth + 1, indent),
|
|
||||||
value_to_string_without_quotes(val, span, depth + 1, indent,)?
|
value_to_string_without_quotes(val, span, depth + 1, indent,)?
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user