diff --git a/src/Alignment.hs b/src/Alignment.hs index 1d887ddca..fed84c874 100644 --- a/src/Alignment.hs +++ b/src/Alignment.hs @@ -143,11 +143,11 @@ group2 ranges child | Just (headRanges, tailRanges) <- unconsThese ranges , (first:rest) <- child = case fromThese False False . runJoin $ intersects headRanges child of (True, True) -> let (moreRanges, restOfChild) = group2 tailRanges rest in - (moreRanges, (pairRangeWithLine headRanges first) : restOfChild) + (moreRanges, pairRangeWithLine headRanges first : restOfChild) (True, False) -> let (moreRanges, restOfChild) = group2 (atLeft ranges) rest in - (moreRanges, (pairRangeWithLine headRanges first) : restOfChild) + (moreRanges, pairRangeWithLine headRanges first : restOfChild) (False, True) -> let (moreRanges, restOfChild) = group2 (atRight ranges) rest in - (moreRanges, (pairRangeWithLine headRanges first) : restOfChild) + (moreRanges, pairRangeWithLine headRanges first : restOfChild) _ -> (tailRanges, [ flip (,) [] <$> headRanges ]) | otherwise = (ranges, []) where atLeft (Join (These (_:as) bs)) = Join (These as bs)