Skip to content

Commit

Permalink
further reduce newlines for compact output (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
juhp committed Jun 3, 2022
1 parent 380829e commit ebf5b71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Text/Pretty/Simple/Internal/Printer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@ prettyExpr opts = (if outputOptionsCompact opts then group else id) . \case
spaceIfNeeded = \case
Other (' ' : _) : _ -> mempty
_ -> space
lineAndCommaSep x y = x <> line' <> annotate Comma "," <> y
lineAndCommaSep x y =
if outputOptionsCompact opts
then x <> annotate Comma "," <> y
else x <> line' <> annotate Comma "," <> y

-- | Determine whether this expression should be displayed on a single line.
isSimple :: Expr -> Bool
Expand Down

0 comments on commit ebf5b71

Please sign in to comment.