Open sellout opened 4 years ago
This got worse recently, with every added foo $
in the pipeline shifting the subsequent expression block by two chars.
foo =
x $
y $ do
a
b
This got worse recently
The example may look ugly with single-letter names, but IMO that's on single-letter names.
reasonably =
namedWrapper $
doingSomeStuff $ do
this
that
Sure. The problem is that I can't choose whether I want namedWrapper $ doingSomeStuff $ do
to be on one line or two lines. I have to replace $
with .
.
No wait, nevermind, that's an unrelated problem.
Describe the bug The positioning of
$
changes depending other line breaks in the expression.To Reproduce
Now add a composition before the application:
So far, so good, but if
composedExpr
makes the line too long, I break it:Then Ormolu reformats it like
changing the
otherExpr
line, which was previously diff-clean. This seems to go against the diff-friendliness of Ormolu. Also, AFAICT, it's special handling of$
-- other operators seem to always be after a line break, but I'm not sure if that's true or if there's a subtle distinction I'm missing.Expected behavior Probably, I expect the first expression above to be formatted
keeping the second line stable no matter how long the expression before it gets. In fact, this formatting keeps both the
shortExpr
andotherExpr
line clean, and the current behavior makes them both dirty.Environment
Additional context