Skip to content

Commit

Permalink
Merge pull request #54 from serokell/fix-parens
Browse files Browse the repository at this point in the history
Fix indentation of leading comments in parens
  • Loading branch information
yorickvP authored Feb 2, 2020
2 parents 3127137 + c59d959 commit 48bd545
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Nixfmt/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ prettyTerm (Set krec (Ann paropen trailing leading) binders parclose)
<> nest 2 (pretty leading <> sepBy hardline binders) <> line
<> pretty parclose

prettyTerm (Parenthesized paropen expr parclose)
= base $ pretty paropen <> nest 2 (group expr) <> pretty parclose
prettyTerm (Parenthesized (Ann paropen trailing leading) expr parclose)
= base $ pretty paropen <> pretty trailing
<> nest 2 (pretty leading <> group expr) <> pretty parclose

instance Pretty Term where
pretty l@(List _ _ _) = group $ prettyTerm l
Expand Down

0 comments on commit 48bd545

Please sign in to comment.