Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d4f7e21

Browse files
committed
Fix shape for index
1 parent 7665017 commit d4f7e21

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/expr.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,12 @@ fn rewrite_index(
14861486
.offset_left(offset)
14871487
.and_then(|shape| shape.sub_width(1 + rhs_overhead))
14881488
} else {
1489-
shape.visual_indent(offset).sub_width(offset + 1)
1489+
match context.config.indent_style() {
1490+
IndentStyle::Block => shape
1491+
.offset_left(offset)
1492+
.and_then(|shape| shape.sub_width(1)),
1493+
IndentStyle::Visual => shape.visual_indent(offset).sub_width(offset + 1),
1494+
}
14901495
};
14911496
let orig_index_rw = index_shape.and_then(|s| index.rewrite(context, s));
14921497

0 commit comments

Comments
 (0)