mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Show the deleted/inserted line counts.
This commit is contained in:
parent
e22f951038
commit
33aabea60c
@ -8,7 +8,7 @@ patch diff sourceA sourceB = mconcat $ hunks diff sourceA sourceB
|
||||
data Hunk = Hunk Int Int [Line]
|
||||
|
||||
header :: Hunk -> String
|
||||
header (Hunk offsetA offsetB lines) = "@@ -" ++ show offsetA ++ " +" ++ show offsetB ++ " @@\n"
|
||||
header (Hunk offsetA offsetB lines) = "@@ -" ++ show offsetA ++ "," ++ show countDeleted ++ " +" ++ show offsetB ++ "," ++ show countInserted ++ " @@\n"
|
||||
where (countDeleted, countInserted) = foldl countLine (0, 0) lines
|
||||
countLine (countDeleted, countInserted) line = case line of
|
||||
Insert _ -> (countDeleted, countInserted + 1)
|
||||
|
Loading…
Reference in New Issue
Block a user