diff --git a/src/Split.hs b/src/Split.hs index 5aeb9f140..6f22f409d 100644 --- a/src/Split.hs +++ b/src/Split.hs @@ -146,8 +146,9 @@ termToLines (Info range _ categories :< syntax) source = (rows syntax, range) -- | Given an Annotated and before/after strings, returns a list of `Row`s representing the newline-separated diff. annotatedToRows :: Annotated a (Info, Info) (Diff a Info) -> String -> String -> ([Row], (Range, Range)) -annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCategories) (Leaf _)) before after = (zipWithMaybe rowFromMaybeRows leftElements rightElements, (left, right)) +annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCategories) syntax) before after = (rows syntax, (left, right)) where + rows (Leaf _) = zipWithMaybe rowFromMaybeRows leftElements rightElements leftElements = (elementAndBreak $ Span (classify leftCategories)) =<< actualLines (substring left before) rightElements = (elementAndBreak $ Span (classify rightCategories)) =<< actualLines (substring right after)