1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Use the pad function for This.

This commit is contained in:
Rob Rix 2016-04-25 14:01:45 -04:00
parent e214dc3c1d
commit b9b5382b3d

View File

@ -116,7 +116,7 @@ instance Eq PrettyDiff where
instance Show PrettyDiff where
show (PrettyDiff sources lines) = intercalate "\n" (showLine 40 <$> lines)
where showLine n line = case runJoin line of
This before -> let beforeString = showDiff before (fst sources) in beforeString ++ showString (replicate (max 0 (n - length beforeString)) ' ') " | "
This before -> pad n (showDiff before (fst sources)) " | "
That after -> showString (replicate n ' ') (showString " | " (showDiff after (snd sources)))
These before after -> showDiff before (fst sources) ++ showString " | " (showDiff after (snd sources))
showDiff diff = toList . stripNewlines . Source.slice (getRange diff)