1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Adjoin the final context.

This commit is contained in:
Rob Rix 2015-12-04 10:20:26 -05:00
parent d3c5db105d
commit dbdf194f6a

View File

@ -47,7 +47,7 @@ annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCatego
annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCategories) (Indexed i)) before after = (bimap (Ul $ classify leftCategories) (Ul $ classify rightCategories) <$> rows, left, right)
where
rows = appendRemainder $ foldl sumRows ((start left, start right), []) i
appendRemainder ((previousLeft, previousRight), rows) = rows ++ [ Row (Text <$> lines (substring (Range previousLeft $ end left) before)) (Text <$> lines (substring (Range previousRight $ end right) after)) ]
appendRemainder ((previousLeft, previousRight), rows) = adjoinRows rows [ Row (Text <$> lines (substring (Range previousLeft $ end left) before)) (Text <$> lines (substring (Range previousRight $ end right) after)) ]
sumRows ((previousLeft, previousRight), rows) child = ((end left, end right), rows ++ contextRows ++ childRows)
where
(childRows, left, right) = diffToRows child before after