diff --git a/src/Split.hs b/src/Split.hs index 73e7722f5..ba7ab5a43 100644 --- a/src/Split.hs +++ b/src/Split.hs @@ -33,7 +33,7 @@ split diff before after = return . renderHtml . mconcat $ toMarkup <$> reverse numbered where rows = toRenderable <$> fst (splitDiffByLines diff (0, 0) (before, after)) - toRenderable (Row a b) = Row (Renderable . (,) before <$> a) (Renderable . (,) after <$> b) + toRenderable (Row a b) = Row (renderable before a) (renderable after b) numbered = foldl numberRows [] rows maxNumber = case numbered of [] -> 0 @@ -45,6 +45,8 @@ split diff before after = return . renderHtml columnWidth = max (20 + digits maxNumber * 8) 40 + renderable source = fmap (Renderable . (,) source) + numberRows :: [(Int, Line a, Int, Line a)] -> Row a -> [(Int, Line a, Int, Line a)] numberRows [] (Row EmptyLine EmptyLine) = [] numberRows [] (Row left@(Line _) EmptyLine) = [(1, left, 0, EmptyLine)]