Skip to content

Commit cb5ccab

Browse files
sjakobimergify[bot]
authored andcommitted
let-formatting: Insert hardline in front of the '=' instead of behind (#1302)
Fixes #1301.
1 parent 4458cf0 commit cb5ccab

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

dhall/src/Dhall/Pretty/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ prettyCharacterSet characterSet expression =
541541
<> Pretty.align
542542
( renderSrc src0 mempty
543543
<> prettyLabel c <> renderSrc src1 Pretty.hardline
544-
<> colon <> renderSrc src3 space <> prettyExpression d <> space <> equals <> renderSrc src2 Pretty.hardline
544+
<> colon <> renderSrc src3 space <> prettyExpression d <> Pretty.hardline <> equals <> renderSrc src2 space
545545
<> prettyExpression e
546546
)
547547

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let attribute
2+
: Text Text { mapKey : Text, mapValue : Text }
3+
= λ(key : Text) λ(value : Text) { mapKey = key, mapValue = value }
4+
5+
in attribute
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let attribute
2+
: Text Text { mapKey : Text, mapValue : Text }
3+
= λ(key : Text) λ(value : Text) { mapKey = key, mapValue = value }
4+
5+
in attribute
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let x
2-
{- foo -} : {- bar -} Bool =
3-
{- bla -} True
2+
{- foo -} : {- bar -} Bool
3+
= {- bla -} True
44

55
in x

dhall/tests/format/letNewlineCommentsB.dhall

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let x = 1
33
in let {- aaaaaaaaaaaaaaaaaaa
44
-} y
55
: {- bbbbbbbbbbbbbbbbbbbbb
6-
-} Natural =
7-
{- ddddddddddddddddd -} 2
6+
-} Natural
7+
= {- ddddddddddddddddd -} 2
88

99
in x

0 commit comments

Comments
 (0)