-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
bugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.
Description
let's set tab_spaces = 2
, max_width = 10
and struct_variant_width = 10
. I would like for this to format some code like this:
enum F {
X {
a: d,
b: e,
},
}
however what it ends up doing is this:
enum F {
X { a: d, b: e },
}
and printing a warning about how it accidentally formatted the X
line too long.
even though the X
line is longer than 10 spaces. This is because struct_variant_width is really only applying to the fields of the struct (the a: d, b: e
part, not counting wrapping spaces or braces), not the entire line.
Now technically it's documented to match the current behavior: (from Configurations.md):
Maximum width in the body of a struct variant before falling back to vertical formatting
but this seems not very useful IMO. I'm not sure if other "width" settings act like this but I have never run into it anywhere else.
Metadata
Metadata
Assignees
Labels
bugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.