Add visual offset when using struct_lit_style is Visual

This commit is contained in:
Seiichi Uchida 2017-06-10 22:20:11 +09:00
parent c879d5ebd7
commit f2838595d5
2 changed files with 3 additions and 2 deletions

View file

@ -529,7 +529,8 @@ pub fn struct_lit_shape(shape: Shape,
-> Option<(Option<Shape>, Shape)> {
let v_shape = match context.config.struct_lit_style() {
IndentStyle::Visual => {
try_opt!(try_opt!(shape.shrink_left(prefix_width)).sub_width(suffix_width))
try_opt!(try_opt!(shape.visual_indent(0).shrink_left(prefix_width))
.sub_width(suffix_width))
}
IndentStyle::Block => {
let shape = shape.block_indent(context.config.tab_spaces());

View file

@ -3,5 +3,5 @@
fn main() {
let lorem = Lorem { ipsum: dolor,
sit: amet, };
sit: amet, };
}