mirror of
https://github.com/github/semantic.git
synced 2024-12-19 21:01:35 +03:00
simplify appending a row with two newlines
This commit is contained in:
parent
eecfd4ff6d
commit
40cc463a90
@ -183,10 +183,7 @@ rowFromMaybeRows a b = Row (maybe EmptyLine (Line . (:[])) a) (maybe EmptyLine
|
|||||||
adjoin2 :: [Row] -> Row -> [Row]
|
adjoin2 :: [Row] -> Row -> [Row]
|
||||||
adjoin2 [] row = [row]
|
adjoin2 [] row = [row]
|
||||||
-- handle the case where we append a newline on both sides
|
-- handle the case where we append a newline on both sides
|
||||||
adjoin2 rows (Row left@(Line (Text "" : _)) right@(Line (Text "" : _))) = Row left right : zipWith Row lefts rights
|
adjoin2 rows (Row left@(Line (Text "" : _)) right@(Line (Text "" : _))) = Row left right : rows
|
||||||
where
|
|
||||||
lefts = leftLines rows
|
|
||||||
rights = rightLines rows
|
|
||||||
adjoin2 rows (Row left@(Line (Text "" : _)) right) = Row left EmptyLine : zipWith Row lefts rights
|
adjoin2 rows (Row left@(Line (Text "" : _)) right) = Row left EmptyLine : zipWith Row lefts rights
|
||||||
where
|
where
|
||||||
lefts = leftLines rows
|
lefts = leftLines rows
|
||||||
|
Loading…
Reference in New Issue
Block a user