diff --git a/src/PatchOutput.hs b/src/PatchOutput.hs index 8912fc212..fec9eb079 100644 --- a/src/PatchOutput.hs +++ b/src/PatchOutput.hs @@ -29,8 +29,10 @@ showChange sources change = concat (showLine ' ' (snd sources) . unRight <$> con where showRow (Row lineA lineB) = if lineA == lineB then showLine ' ' (snd sources) lineB else showLine '-' (fst sources) lineA ++ showLine '+' (snd sources) lineB - showLine _ _ EmptyLine = "" - showLine prefix source line = prefix : (toString . (`slice` source) . unionRanges $ getRange <$> unLine line) + +showLine :: Char -> Source Char -> Line (SplitDiff leaf Info) -> String +showLine _ _ EmptyLine = "" +showLine prefix source line = prefix : (toString . (`slice` source) . unionRanges $ getRange <$> unLine line) getRange :: SplitDiff leaf Info -> Range getRange (Free (Annotated (Info range _) _)) = range