Describe the bug
formatting an if-else statement where all blocks are considered "one-liners" formats the whole statement as a single line. (great!)
however if one of the blocks is considered a one-liner but others are not, it should abandon the strategy of keeping as single line. that's how other formatters deal with this.
this also applies to try-catch-finally. maybe other things as well.
Script or statement
if true { foo } else { bar | baz | qux }
Actual behavior/output
formats to
if true { foo } else {
bar | baz | qux
}
Expected behavior/output
if true {
foo
} else {
bar | baz | qux
}
Environment
current github versions of nushell and nufmt
Describe the bug
formatting an if-else statement where all blocks are considered "one-liners" formats the whole statement as a single line. (great!)
however if one of the blocks is considered a one-liner but others are not, it should abandon the strategy of keeping as single line. that's how other formatters deal with this.
this also applies to try-catch-finally. maybe other things as well.
Script or statement
if true { foo } else { bar | baz | qux }Actual behavior/output
formats to
Expected behavior/output
Environment
current github versions of
nushellandnufmt