From 2f37ba14bc126c7fd771b72f8c75c04e6e5f18e2 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 21 Mar 2016 13:38:36 -0400 Subject: [PATCH] Aligned leaf diffs have per-line ranges. --- src/Alignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Alignment.hs b/src/Alignment.hs index 1a8501aed..dba76cd79 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -122,7 +122,7 @@ alignDiff :: Both (Source Char) -> Diff leaf Info -> AlignedDiff leaf alignDiff sources diff = iter alignSyntax (alignPatch sources <$> diff) where alignSyntax :: Annotated leaf (Both Info) (AlignedDiff leaf) -> AlignedDiff leaf alignSyntax (Annotated infos syntax) = case syntax of - Leaf s -> runBothWith ((Join .) . These) $ (\ info -> (Free (Annotated info (Leaf s)) <$)) <$> infos <*> lineRanges + Leaf s -> runBothWith ((Join .) . These) $ (\ info -> fmap (Free . (`Annotated` Leaf s) . setCharacterRange info)) <$> infos <*> lineRanges _ -> Join (These [] []) where lineRanges = actualLineRanges <$> (characterRange <$> infos) <*> sources