From e74c98f9cc74b1eaee1588be640b8ee940eb74fe Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 6 Aug 2017 15:44:28 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20colourize=20the=20whole=20expec?= =?UTF-8?q?tation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data/Error.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Error.hs b/src/Data/Error.hs index 526e05c64..9576d74e8 100644 --- a/src/Data/Error.hs +++ b/src/Data/Error.hs @@ -35,7 +35,7 @@ formatError :: IncludeSource -> Colourize -> Blob -> Error String -> String formatError includeSource colourize Blob{..} Error{..} = ($ "") $ withSGRCode colourize [SetConsoleIntensity BoldIntensity] (showSpan (maybe Nothing (const (Just blobPath)) blobKind) errorSpan . showString ": ") - . withSGRCode colourize [SetColor Foreground Vivid Red] (showString "error" . showString ": " . showExpectation errorExpected errorActual . showChar '\n') + . withSGRCode colourize [SetColor Foreground Vivid Red] (showString "error") . showString ": " . showExpectation errorExpected errorActual . showChar '\n' . (if includeSource then showString (unpack context) . (if "\n" `isSuffixOf` context then id else showChar '\n') . showString (replicate (succ (posColumn (spanStart errorSpan) + lineNumberDigits)) ' ') . withSGRCode colourize [SetColor Foreground Vivid Green] (showChar '^' . showChar '\n')