diff --git a/src/Diffing.hs b/src/Diffing.hs index e0346942d..cd330d18e 100644 --- a/src/Diffing.hs +++ b/src/Diffing.hs @@ -56,7 +56,7 @@ breakDownLeavesByWord source = cata replaceIn replaceIn (Info range categories _) (Leaf _) | ranges <- rangesAndWordsInSource range , length ranges > 1 = Info range categories (1 + fromIntegral (length ranges)) :< Indexed (makeLeaf categories <$> ranges) - replaceIn info syntax = info :< syntax + replaceIn info@(Info range categories _) syntax = Info range categories (1 + sum (size . copoint <$> syntax)) :< syntax rangesAndWordsInSource range = rangesAndWordsFrom (start range) (toString $ slice range source) makeLeaf categories (range, substring) = Info range categories 1 :< Leaf (T.pack substring)