Skip to content

Bug: formatting can go over the set margin #2771

@shym

Description

@shym

Sometimes the set margin gets lost in reformatting.

Using ocamlformat v0.28.1 with the default configuration (in particular margin set to 80 columns), here are two small examples where we see ) and , can appear in the 81-th and 82-th columns.

let a = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + (1 * (1 + 1))

let b =
  ( 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + (1 * (1 + 1)),
    1 )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions