Skip to content

Commit

Permalink
Add whitespace before and after REPL output (dhall-lang#347)
Browse files Browse the repository at this point in the history
This adds an additional newline before and after each output line in the
REPL so that it's easier to visually separate commands from their
results
  • Loading branch information
Gabriella439 authored Apr 5, 2018
1 parent d473f83 commit 9b5be7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dhall-repl/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ output
:: (Pretty.Pretty a, MonadIO m)
=> System.IO.Handle -> Dhall.Expr s a -> m ()
output handle expr = do
liftIO (System.IO.hPutStrLn handle "") -- Visual spacing

let opts =
Pretty.defaultLayoutOptions
{ Pretty.layoutPageWidth = Pretty.AvailablePerLine 80 1.0 }
Expand All @@ -244,5 +246,6 @@ output handle expr = do
else Pretty.unAnnotateS stream

liftIO (Pretty.renderIO handle ansiStream)
liftIO (System.IO.hPutStrLn handle "") -- Pretty printing doesn't end with a new line

liftIO (putStrLn "") -- Pretty printing doesn't end with a new line
liftIO (System.IO.hPutStrLn handle "") -- Visual spacing

0 comments on commit 9b5be7b

Please sign in to comment.