If I have a file called test.odin:
package main
import "core:fmt"
main :: proc() {
switch 'a' {
case 'b':
if true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true {
if true {
fmt.println("a")
} else {
fmt.println("b")
}
}
}
}
And in my odinfmt.json file I set:
{
"$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/odinfmt.schema.json",
"inline_single_stmt_case": true,
}
Then, when I run odinfmt -path:test.odin, I get the incorrectly formatted:
package main
import "core:fmt"
main :: proc() {
switch 'a' {
case 'b':
if true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true &&
true {
if true {
fmt.println("a")
}
else {
fmt.println("b")
}
}
}
}
If I have a file called
test.odin:And in my
odinfmt.jsonfile I set:{ "$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/odinfmt.schema.json", "inline_single_stmt_case": true, }Then, when I run
odinfmt -path:test.odin, I get the incorrectly formatted: