mirror of
https://github.com/github/semantic.git
synced 2024-11-24 17:04:47 +03:00
Move showLine to the top level.
This commit is contained in:
parent
be2476cfda
commit
636e526311
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user