Skip to content

Pretty printer could use heuristics to detect pointless line breaks #882

Closed
@marijnh

Description

@marijnh

The most glaring example is

r =
    {some long expression that did not fit
     on a line};

... where the line break doesn't even create any space. But there are other situations, like

let foo =
    {multiline: record,
     literal: 100};

Here the literal would have fit just fine without the line break. We could probably make it not add the line break if the first line of the following block fits on a line. (Though that information is not currently being produced by the 'new' pretty-printer.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-prettyArea: Pretty printing (including `-Z unpretty`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions