Fix shape for index

This commit is contained in:
Seiichi Uchida 2018-09-19 23:21:07 +09:00
parent 76650174c7
commit d4f7e219dc

View file

@ -1486,7 +1486,12 @@ fn rewrite_index(
.offset_left(offset)
.and_then(|shape| shape.sub_width(1 + rhs_overhead))
} else {
shape.visual_indent(offset).sub_width(offset + 1)
match context.config.indent_style() {
IndentStyle::Block => shape
.offset_left(offset)
.and_then(|shape| shape.sub_width(1)),
IndentStyle::Visual => shape.visual_indent(offset).sub_width(offset + 1),
}
};
let orig_index_rw = index_shape.and_then(|s| index.rewrite(context, s));