Commit 52d9992f authored by Daniel Trstenjak's avatar Daniel Trstenjak
Browse files

Fix pretty printing with showFreeText

Remove the special casing for strings starting with a newline.
Handle all newlines in strings the same way, by replacing them
with a '.'.
parent 954be543
......@@ -733,7 +733,6 @@ showTestedWith (compiler, version) = text (show compiler) <+> disp version
-- and with blank lines replaced by dots for correct re-parsing.
showFreeText :: String -> Doc
showFreeText "" = empty
showFreeText ('\n' :r) = text " " $+$ text "." $+$ showFreeText r
showFreeText s = vcat [text (if null l then "." else l) | l <- lines_ s]
-- | 'lines_' breaks a string up into a list of strings at newline
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment