From 3937b074c9bfaca0b26cd63bc75f791895ee59a4 Mon Sep 17 00:00:00 2001 From: Mesabloo <22964017+Mesabloo@users.noreply.github.com> Date: Mon, 14 Sep 2020 18:18:51 +0200 Subject: [PATCH] Report: improve custom pretty printer to handle new lines --- src/Text/Diagnose/Report.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Diagnose/Report.hs b/src/Text/Diagnose/Report.hs index 1fb1b76..ac6115c 100644 --- a/src/Text/Diagnose/Report.hs +++ b/src/Text/Diagnose/Report.hs @@ -161,7 +161,7 @@ prettyMarker underlineLen marker colorThis colorWhere colorMaybe = case marker o -- | A smarter pretty to keep long texts in between the bounds and correctly align them. smartPretty :: (PrettyText d) => d -> Doc -smartPretty = fillSep . fmap text . words . show . prettyText +smartPretty = vsep . fmap (fillSep . fmap text . words) . lines . show . prettyText -- | Applies a function to the list if it isn't '[]', else returns it.