I don't think that's the fix for if-then-else. This does:
if gf then
(* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *)
- begin if
- a
- then
- b
- end
+ begin if a then b
+ end
I think the right output would be:
if gf then
(* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *)
begin
if a then b
end
because without the comment it is:
if gf then begin
if a then b
end
The body of the begin-end shouldn't reindent if a comment is added around it. This should be doable with boxes instead of adding a new special case.
Originally posted by @Julow in ocaml-ppx/ocamlformat#2810 (comment)
I don't think that's the fix for if-then-else. This does:
if gf then (* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *) - begin if - a - then - b - end + begin if a then b + endI think the right output would be:
because without the comment it is:
The body of the begin-end shouldn't reindent if a comment is added around it. This should be doable with boxes instead of adding a new special case.
Originally posted by @Julow in ocaml-ppx/ocamlformat#2810 (comment)