File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3223,7 +3223,14 @@ and print_expression ~state (e : Parsetree.expression) cmt_tbl =
32233223 * b: 2,
32243224 * }` -> record is written on multiple lines, break the group *)
32253225 let force_break =
3226- e.pexp_loc.loc_start.pos_lnum < e.pexp_loc.loc_end.pos_lnum
3226+ match (spread_expr, rows) with
3227+ | Some expr , _ ->
3228+ (* If there's a spread, compare with spread expression's location *)
3229+ e.pexp_loc.loc_start.pos_lnum < expr.pexp_loc.loc_start.pos_lnum
3230+ | None , first_row :: _ ->
3231+ (* Otherwise, compare with the first row's location *)
3232+ e.pexp_loc.loc_start.pos_lnum < first_row.lid.loc.loc_start.pos_lnum
3233+ | None , [] -> false
32273234 in
32283235 let punning_allowed =
32293236 match (spread_expr, rows) with
You can’t perform that action at this time.
0 commit comments