1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Strip newlines in the output diff.

This commit is contained in:
Rob Rix 2016-04-25 13:55:39 -04:00
parent 938b89f8db
commit d9c2bb8e4c

View File

@ -119,5 +119,5 @@ instance Show PrettyDiff where
This before -> let beforeString = showDiff before (fst sources) in beforeString ++ showString (replicate (max 0 (min n (n - length beforeString))) ' ') " | " This before -> let beforeString = showDiff before (fst sources) in beforeString ++ showString (replicate (max 0 (min n (n - length beforeString))) ' ') " | "
That after -> showString (replicate n ' ') (showString " | " (showDiff after (snd sources))) That after -> showString (replicate n ' ') (showString " | " (showDiff after (snd sources)))
These before after -> showDiff before (fst sources) ++ showString " | " (showDiff after (snd sources)) These before after -> showDiff before (fst sources) ++ showString " | " (showDiff after (snd sources))
showDiff diff = toList . Source.slice (getRange diff) showDiff diff = toList . stripNewlines . Source.slice (getRange diff)
stripNewlines = fmap (\ c -> if c == '\n' then ' ' else c) stripNewlines = fmap (\ c -> if c == '\n' then ' ' else c)