diff options
| author | Seiichi Uchida <seuchida@gmail.com> | 2018-09-19 23:21:07 +0900 |
|---|---|---|
| committer | Seiichi Uchida <seuchida@gmail.com> | 2018-09-19 23:21:07 +0900 |
| commit | d4f7e219dcd74989f695fe261534cc8fef5b1477 (patch) | |
| tree | 59392a8185fa52910432567a4666a68c61365916 /src/expr.rs | |
| parent | 76650174c70ca443936d2187a2edecff6dbd5d25 (diff) | |
Fix shape for index
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/expr.rs b/src/expr.rs index fef4a024cf5..a5d1cdd5583 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -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)); |
