Skip to content

I don't think that's the fix for if-then-else. This does: #171

Description

@Abacha234

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions