mirror of
https://github.com/nushell/nushell.git
synced 2025-06-03 08:36:32 +02:00
add tool function to compute the true indentation and newline
This commit is contained in:
parent
1d11c388e3
commit
ff93bb6894
@ -258,6 +258,20 @@ pub fn value_to_string(
|
||||
}
|
||||
}
|
||||
|
||||
fn get_true_indentation(depth: usize, indent: &Option<String>) -> String {
|
||||
match indent {
|
||||
Some(i) => i.repeat(depth),
|
||||
None => "".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_true_newline(indent: &Option<String>) -> String {
|
||||
match indent {
|
||||
Some(_) => "\n".to_string(),
|
||||
None => "".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
fn value_to_string_without_quotes(
|
||||
v: &Value,
|
||||
span: Span,
|
||||
|
Loading…
x
Reference in New Issue
Block a user