1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Strip newlines inline.

This commit is contained in:
Rob Rix 2016-04-25 15:00:46 -04:00
parent 3a3458684d
commit 55af6c2001

View File

@ -115,7 +115,6 @@ instance Show PrettyDiff where
where shownLines = toBoth <$> lines
showLine n line = let (before, after) = fromThese (replicate n ' ') (replicate n ' ') (runJoin (pad n <$> line)) in
before ++ " | " ++ after
showDiff diff = stripNewlines . toList . Source.slice (getRange diff)
stripNewlines = filter (/= '\n')
showDiff diff = filter (/= '\n') . toList . Source.slice (getRange diff)
pad n string = showString (take n string) (showString (replicate (max 0 (n - length string)) ' ') "")
toBoth them = showDiff <$> them `applyThese` modifyJoin (uncurry These) sources