From 92d5d9cf4ff2c8296144818c609b22da5f295d81 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 10 Dec 2015 17:27:23 -0500 Subject: [PATCH] Match on `syntax` inside `annotatedToRows`. --- src/Split.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)