mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
When we only have ranges on one side, default the other to assume intersecting.
This commit is contained in:
parent
cb2ffd188c
commit
d99e4ab39b
@ -137,7 +137,7 @@ alignBranch getRange children ranges = case intersectingChildren of
|
||||
-- No child intersects the current ranges on either side, so advance.
|
||||
[] -> (flip (,) [] <$> headRanges) : alignBranch getRange children (drop 1 <$> ranges)
|
||||
-- At least one child intersects on at least one side.
|
||||
_ -> case fromThese False False . runJoin . intersectsFirstLine headRanges <$> listToMaybe remainingIntersectingChildren of
|
||||
_ -> case fromThese True True . runJoin . intersectsFirstLine headRanges <$> listToMaybe remainingIntersectingChildren of
|
||||
-- At least one child intersects on both sides, so align symmetrically.
|
||||
Just (True, True) -> let (line, remaining) = lineAndRemaining intersectingChildren headRanges in
|
||||
line : alignBranch getRange (remaining ++ nonIntersectingChildren) (drop 1 <$> ranges)
|
||||
|
Loading…
Reference in New Issue
Block a user