mirror of
https://github.com/github/semantic.git
synced 2025-01-07 16:07:28 +03:00
Add a function to render numbered lines to markup with indication of changes.
This commit is contained in:
parent
b89218a944
commit
e974ea43af
@ -45,6 +45,9 @@ split diff before after = return . renderHtml
|
|||||||
|
|
||||||
columnWidth = max (20 + digits maxNumber * 8) 40
|
columnWidth = max (20 + digits maxNumber * 8) 40
|
||||||
|
|
||||||
|
numberedLinesToMarkup :: (Int, Line (SplitDiff a Info), Int, Line (SplitDiff a Info)) -> Markup
|
||||||
|
numberedLinesToMarkup (m, left, n, right) = tr $ toMarkup (foldl (||) False $ hasChanges <$> unLine left, m, renderable before left) <> toMarkup (foldl (||) False $ hasChanges <$> unLine right, n, renderable after right) <> string "\n"
|
||||||
|
|
||||||
renderable source = fmap (Renderable . (,) source)
|
renderable source = fmap (Renderable . (,) source)
|
||||||
|
|
||||||
hasChanges diff = foldl (||) False $ const True <$> diff
|
hasChanges diff = foldl (||) False $ const True <$> diff
|
||||||
|
Loading…
Reference in New Issue
Block a user