From 636e526311f8077bf78db9c16dcd01890d478b45 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 30 Dec 2015 15:27:00 -0500 Subject: [PATCH] Move showLine to the top level. --- src/PatchOutput.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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