~jaro/balkon

600105549348121bf2d6adabcf0e1d4ccb6cf4d6 — Jaro 1 year, 8 months ago 6e42cae
Fix compatibility with base < 4.15.
M CHANGELOG.md => CHANGELOG.md +4 -0
@@ 1,5 1,9 @@
# Revision history for Balkón

## 0.3.0.1 -- TBD

* Fixed compatibility with base < 4.15.

## 0.3.0.0 -- 2023-04-13

* Added partial support for bidirectional text

M src/Data/Text/ParagraphLayout/Internal/Plain.hs => src/Data/Text/ParagraphLayout/Internal/Plain.hs +1 -1
@@ 87,7 87,7 @@ layoutLines ::
    Int32 -> NonEmpty (WithSpan Run) -> NonEmpty [WithSpan PF.ProtoFragment]
layoutLines maxWidth runs = case nonEmpty rest of
        -- Everything fits. We are done.
        Nothing -> NonEmpty.singleton fitting
        Nothing -> fitting :| []
        -- Something fits, the rest goes on the next line.
        Just rest' -> fitting <| layoutLines maxWidth rest'
    where

M src/Data/Text/ParagraphLayout/Internal/TextContainer.hs => src/Data/Text/ParagraphLayout/Internal/TextContainer.hs +2 -2
@@ 116,7 116,7 @@ trimTextsStartPreserve :: SeparableTextContainer a =>
    (Char -> Bool) -> NonEmpty a -> NonEmpty a
trimTextsStartPreserve p tcs =
    case nonEmpty $ trimTextsStart p $ NonEmpty.toList tcs of
        Nothing -> NonEmpty.singleton $ truncateText $ NonEmpty.head tcs
        Nothing -> truncateText (NonEmpty.head tcs) :| []
        Just out -> out

-- | Treat a list of text containers as a contiguous sequence,


@@ 137,7 137,7 @@ trimTextsEndPreserve :: SeparableTextContainer a =>
    (Char -> Bool) -> NonEmpty a -> NonEmpty a
trimTextsEndPreserve p tcs =
    case nonEmpty $ trimTextsEnd p $ NonEmpty.toList tcs of
        Nothing -> NonEmpty.singleton $ truncateText $ NonEmpty.head tcs
        Nothing -> truncateText (NonEmpty.head tcs) :| []
        Just out -> out

trimTextsStart' :: SeparableTextContainer a => (Char -> Bool) -> [a] -> [a]