1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 12:21:57 +03:00

Don’t adjoin empty/empty rows onto the top.

This commit is contained in:
Rob Rix 2015-12-10 14:34:52 -05:00
parent 1b370a059d
commit 14de32f3e9

View File

@ -191,6 +191,8 @@ maybeLast list = listToMaybe $ reverse list
adjoin2 :: [Row] -> Row -> [Row]
adjoin2 [] row = [row]
adjoin2 rows (Row EmptyLine EmptyLine) = rows
adjoin2 (Row EmptyLine EmptyLine : rows) row = adjoin2 rows row
adjoin2 rows (Row left' right') | Just _ <- openLine $ leftLines rows, Just _ <- openLine $ rightLines rows = zipWith Row lefts rights