From 57a30624460f1b7942e3356abfebe2167f4409ed Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 10 Dec 2015 16:11:13 -0500 Subject: [PATCH] Fold adjoin2Lines over leaves. --- src/Split.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Split.hs b/src/Split.hs index 01d01aa4e..2c3b546fc 100644 --- a/src/Split.hs +++ b/src/Split.hs @@ -127,7 +127,7 @@ diffToRows (Pure (Replace a b)) _ before after = (replacedRows, (leftRange, righ termToLines :: Term a Info -> String -> ([Line], Range) termToLines (Info range _ categories :< syntax) source = (rows syntax, range) where - rows (Leaf _) = Line . (:[]) <$> elements + rows (Leaf _) = reverse $ foldl adjoin2Lines [] $ Line . (:[]) <$> elements rows (Indexed i) = rewrapLineContentsInUl <$> childLines i rewrapLineContentsInUl (Line elements) = Line [ Ul (classify categories) elements ]