diff --git a/Language/Haskell/GhcMod/Pretty.hs b/Language/Haskell/GhcMod/Pretty.hs index 5526772..1df6948 100644 --- a/Language/Haskell/GhcMod/Pretty.hs +++ b/Language/Haskell/GhcMod/Pretty.hs @@ -55,11 +55,16 @@ fnDoc :: FilePath -> Doc fnDoc = doubleQuotes . text showDoc :: Show a => a -> Doc -showDoc = text . show +showDoc = strLnDoc . show warnDoc :: Doc -> Doc warnDoc d = text "Warning" <+>: d +strLnDoc :: String -> Doc +strLnDoc str = doc (dropWhileEnd isSpace str) + where + doc = lines >>> map text >>> foldr ($+$) empty + strDoc :: String -> Doc strDoc str = doc (dropWhileEnd isSpace str) where