Skip to content

Commit

Permalink
Fix box within if-then-else branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetiot authored and Julow committed Jan 16, 2024
1 parent 7f87a4e commit 8e4920a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/Params.ml
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ let get_if_then_else (c : Conf.t) ~first ~last ~parens_bch ~parens_prev_bch
~wrap_breaks:
(get_parens_breaks ~opn_hint_indent:0
~cls_hint:((1, 0), (1000, -2)) )
; box_expr= Some false
; box_expr= None
; expr_pro= None
; expr_eol= None
; branch_expr
Expand Down
4 changes: 2 additions & 2 deletions test/passing/tests/exp_grouping.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ let _ =

let () =
if a
then begin b
(* asd *)
then begin
b (* asd *)
end

[@@@ocamlformat "if-then-else=k-r"]
Expand Down
4 changes: 2 additions & 2 deletions test/passing/tests/ite-kw_first.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ let _ =
if x
then
fun xxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy zzzzzzzzzzz ->
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
else
fun xxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy zzzzzzzzzzz ->
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz

let _ =
if
Expand Down
4 changes: 2 additions & 2 deletions test/passing/tests/ite-kw_first_closing.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ let _ =
if x
then
fun xxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy zzzzzzzzzzz ->
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
else
fun xxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy zzzzzzzzzzz ->
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz

let _ =
if
Expand Down
4 changes: 2 additions & 2 deletions test/passing/tests/ite-kw_first_no_indicate.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ let _ =
if x
then
fun xxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy zzzzzzzzzzz ->
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
else
fun xxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy zzzzzzzzzzz ->
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz
xxxxxxxxx yyyyyyyyyy zzzzzzzzzzzz

let _ =
if
Expand Down

0 comments on commit 8e4920a

Please sign in to comment.