From 8651d5f9b25c7da7b28c7d0ed8e20c58b60a97d8 Mon Sep 17 00:00:00 2001 From: Mesabloo <22964017+Mesabloo@users.noreply.github.com> Date: Sun, 26 Jun 2022 10:55:00 +0200 Subject: [PATCH] fix order of multiline markers when printing --- src/Error/Diagnose/Report/Internal.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Error/Diagnose/Report/Internal.hs b/src/Error/Diagnose/Report/Internal.hs index e413b50..2f595d1 100644 --- a/src/Error/Diagnose/Report/Internal.hs +++ b/src/Error/Diagnose/Report/Internal.hs @@ -428,7 +428,7 @@ prettyAllLines files withUnicode isError tabSize leftLen inline multiline lineNu showMultiline _ [] = mempty showMultiline isLastMultiline multiline = - let colorOfLastMultilineMarker = markerColor isError . snd <$> List.safeLast multiline + let colorOfFirstMultilineMarker = markerColor isError . snd <$> List.safeHead multiline -- take the color of the last multiline marker in case we need to add additional bars prefix = hardline <+> dotPrefix leftLen withUnicode <> space @@ -446,7 +446,7 @@ prettyAllLines files withUnicode isError tabSize leftLen inline multiline lineNu showMultilineMarkerMessages [] = [] showMultilineMarkerMessages [m] = [showMultilineMarkerMessage m True] showMultilineMarkerMessages (m : ms) = showMultilineMarkerMessage m False : showMultilineMarkerMessages ms - in prefixWithBar colorOfLastMultilineMarker <> prefix <> fold (List.intersperse prefix $ showMultilineMarkerMessages $ reverse multiline) + in prefixWithBar colorOfFirstMultilineMarker <> prefix <> fold (List.intersperse prefix $ showMultilineMarkerMessages multiline) -- | getLine_ :: HashMap FilePath [String] -> [(Position, Marker msg)] -> Int -> Int -> Bool -> (IntMap.HashMap Int Int, Doc Annotation)