Skip to content

Layout is sometimes indented less than the line of the layout trigger #712

@cdsmith

Description

@cdsmith

Ormolu currently formats this way:

foo | x <-
        5 = case x of
  5 -> True
  _ -> False

The combination of the extra indent from wrapping the guard, and the case layout to the left of that indent, is very difficult to read. Lots of options would be better, including:

  1. Always Indenting a layout context at least as far as the indent on the line where the layout trigger occurs.
  2. Insisting on a newline after the =, so that this doesn't arise in the first place.

I don't have strong preference between the two, but the current behavior was a real WTF moment.

Metadata

Metadata

Assignees

Labels

styleNitpicking and things related to purely visual aspect for formatting.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions