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