~jaro/balkon

8b8b095a2d7cc321b520b3d3dc707f3f0501d2e3 — Jaro 1 year, 7 months ago e9a66c2
Fix documentation: internal references.
M src/Data/Text/ParagraphLayout/Internal/Layout.hs => src/Data/Text/ParagraphLayout/Internal/Layout.hs +2 -2
@@ 196,8 196,8 @@ layoutAndWrapRunsH maxWidth prevOpenBoxes runs = NonEmpty.head $ validProtoLines
        --       shortest hard break.
        splits = hardSplit runs :| softSplits runs

-- | Construct a `ProtoLine`, peeking at the text run on the following line
-- to determine `nextOpenBoxes`.
-- | Construct a `PL.ProtoLine`, peeking at the text run on the following line
-- to determine `PL.nextOpenBoxes`.
protoLine
    :: [RB.ResolvedBox d]
    -> [ProtoFragmentWithSpan d]

M src/Data/Text/ParagraphLayout/Internal/ParagraphLine.hs => src/Data/Text/ParagraphLayout/Internal/ParagraphLine.hs +3 -3
@@ 56,11 56,11 @@ instance GenericLayout (R.ParagraphLayout d) where
    shiftFragments dy = R.mapFragments (shiftFragment dy)
    appendFragments = R.appendFragments

-- | Split the given `ParagraphLayout` into single-line layouts.
-- | Split the given paragraph layout into single-line layouts.
cutLines :: GenericLayout pl => pl -> [pl]
cutLines pl = map (\ n -> cutLine n pl) (lineNumbers pl)

-- | Reduce the given `ParagraphLayout` to fragments with the given line number.
-- | Reduce the given paragraph layout to fragments with the given line number.
cutLine :: GenericLayout pl => Int -> pl -> pl
cutLine n pl = trimTop $ limitFragments n pl



@@ 78,7 78,7 @@ uniqueFragmentLines frags = dedupe $ map fragmentLine frags
dedupe :: Eq a => [a] -> [a]
dedupe xs = map NonEmpty.head $ NonEmpty.group xs

-- | Put the given `ParagraphLayout`s together as a vertically contiguous
-- | Put the given paragraph layouts together as a vertically contiguous
-- sequence.
mergeLines :: GenericLayout pl => [pl] -> pl
mergeLines lls = foldl mergeLine empty lls