ennocramer / floskell

Floskell is a flexible Haskell source code pretty printer.
BSD 3-Clause "New" or "Revised" License
178 stars 22 forks source link

Strange behavior of case statement aligning #37

Closed epeery closed 5 years ago

epeery commented 5 years ago

Case statement aligning occasionally stops working when used with certain datatypes. Config is the base config with case alignment turned on.

Here's a video showing some of the different senarios I found. asciicast

ennocramer commented 5 years ago

This is intended behavior. The idea being that if the branches have wildly different length, you probably do not want to align them. You can configure the limits to which alignment is allowed with the formatting.align.limits element in your floskell.json. See the section on tabstop alignment in the documentation.

You can force Floskell to always align by setting the second value (relative limit) to 100.