1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Render hunks’ trailing context.

This commit is contained in:
Rob Rix 2015-12-30 15:29:17 -05:00
parent 2fc7d8f537
commit d2f63f77f1

View File

@ -22,7 +22,7 @@ data Change a = Change { context :: [Row a], contents :: [Row a] }
deriving (Eq, Show)
showHunk :: Eq a => (Source Char, Source Char) -> Hunk (SplitDiff a Info) -> String
showHunk sources hunk = header hunk ++ concat (showChange sources <$> changes hunk)
showHunk sources hunk = header hunk ++ concat (showChange sources <$> changes hunk) ++ concat (showLine ' ' (snd sources) . unRight <$> trailingContext hunk)
showChange :: Eq a => (Source Char, Source Char) -> Change (SplitDiff a Info) -> String
showChange sources change = concat (showLine ' ' (snd sources) . unRight <$> context change) ++ concat (showRow sources <$> contents change)