vty 5.13 → 5.14
raw patch · 19 files changed
+101/−25 lines, 19 files
Files
- CHANGELOG +9/−0
- dist/build/verify-attribute-opsStub/verify-attribute-opsStub-tmp/verify-attribute-opsStub.hs +5/−0
- dist/build/verify-crop-span-generationStub/verify-crop-span-generationStub-tmp/verify-crop-span-generationStub.hs +5/−0
- dist/build/verify-display-attributesStub/verify-display-attributesStub-tmp/verify-display-attributesStub.hs +5/−0
- dist/build/verify-empty-image-propsStub/verify-empty-image-propsStub-tmp/verify-empty-image-propsStub.hs +5/−0
- dist/build/verify-eval-terminfo-capsStub/verify-eval-terminfo-capsStub-tmp/verify-eval-terminfo-capsStub.hs +5/−0
- dist/build/verify-image-opsStub/verify-image-opsStub-tmp/verify-image-opsStub.hs +5/−0
- dist/build/verify-image-transStub/verify-image-transStub-tmp/verify-image-transStub.hs +5/−0
- dist/build/verify-inlineStub/verify-inlineStub-tmp/verify-inlineStub.hs +5/−0
- dist/build/verify-layers-span-generationStub/verify-layers-span-generationStub-tmp/verify-layers-span-generationStub.hs +5/−0
- dist/build/verify-parse-terminfo-capsStub/verify-parse-terminfo-capsStub-tmp/verify-parse-terminfo-capsStub.hs +5/−0
- dist/build/verify-simple-span-generationStub/verify-simple-span-generationStub-tmp/verify-simple-span-generationStub.hs +5/−0
- dist/build/verify-terminalStub/verify-terminalStub-tmp/verify-terminalStub.hs +5/−0
- dist/build/verify-using-mock-terminalStub/verify-using-mock-terminalStub-tmp/verify-using-mock-terminalStub.hs +5/−0
- dist/build/verify-utf8-widthStub/verify-utf8-widthStub-tmp/verify-utf8-widthStub.hs +5/−0
- src/Graphics/Vty/Image.hs +4/−9
- src/Graphics/Vty/Image/Internal.hs +4/−4
- src/Graphics/Vty/PictureToSpans.hs +13/−11
- vty.cabal +1/−1
CHANGELOG view
@@ -1,3 +1,12 @@+5.14+ - addMaybeClippedJoin: instead of raising an exception when the join+ is totally clipped, just reduce the clip amount and continue+ - addMaybeClipped: skip blit of joins when their primary dimension is+ zero+ - 'string' and related text functions no longer treat an empty string+ as an empty image (thanks Chris Penner). This means that now it is+ possible to use 'str ""' as a non-empty image with height 1.+ 5.13 - Reverted changes in 5.12 due to disagreements between terminal emulators and utf8proc; for more details, please see the ticket discussion at
+ dist/build/verify-attribute-opsStub/verify-attribute-opsStub-tmp/verify-attribute-opsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyAttributeOps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-crop-span-generationStub/verify-crop-span-generationStub-tmp/verify-crop-span-generationStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyCropSpanGeneration ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-display-attributesStub/verify-display-attributesStub-tmp/verify-display-attributesStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyDisplayAttributes ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-empty-image-propsStub/verify-empty-image-propsStub-tmp/verify-empty-image-propsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyEmptyImageProps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-eval-terminfo-capsStub/verify-eval-terminfo-capsStub-tmp/verify-eval-terminfo-capsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyEvalTerminfoCaps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-image-opsStub/verify-image-opsStub-tmp/verify-image-opsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyImageOps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-image-transStub/verify-image-transStub-tmp/verify-image-transStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyImageTrans ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-inlineStub/verify-inlineStub-tmp/verify-inlineStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyInline ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-layers-span-generationStub/verify-layers-span-generationStub-tmp/verify-layers-span-generationStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyLayersSpanGeneration ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-parse-terminfo-capsStub/verify-parse-terminfo-capsStub-tmp/verify-parse-terminfo-capsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyParseTerminfoCaps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-simple-span-generationStub/verify-simple-span-generationStub-tmp/verify-simple-span-generationStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifySimpleSpanGeneration ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-terminalStub/verify-terminalStub-tmp/verify-terminalStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyOutput ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-using-mock-terminalStub/verify-using-mock-terminalStub-tmp/verify-using-mock-terminalStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyUsingMockTerminal ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-utf8-widthStub/verify-utf8-widthStub-tmp/verify-utf8-widthStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyUtf8Width ( tests )+main :: IO ()+main = stubMain tests
src/Graphics/Vty/Image.hs view
@@ -88,17 +88,13 @@ -- | A Data.Text.Lazy value text :: Attr -> TL.Text -> Image-text a txt- | TL.length txt == 0 = EmptyImage- | otherwise = let displayWidth = safeWcswidth (TL.unpack txt)- in HorizText a txt displayWidth (fromIntegral $! TL.length txt)+text a txt = let displayWidth = safeWcswidth (TL.unpack txt)+ in HorizText a txt displayWidth (fromIntegral $! TL.length txt) -- | A Data.Text value text' :: Attr -> T.Text -> Image-text' a txt- | T.length txt == 0 = EmptyImage- | otherwise = let displayWidth = safeWcswidth (T.unpack txt)- in HorizText a (TL.fromStrict txt) displayWidth (T.length txt)+text' a txt = let displayWidth = safeWcswidth (T.unpack txt)+ in HorizText a (TL.fromStrict txt) displayWidth (T.length txt) -- | an image of a single character. This is a standard Haskell 31-bit character assumed to be in -- the ISO-10646 encoding.@@ -117,7 +113,6 @@ -- directly to iso10646String or string. -- iso10646String :: Attr -> String -> Image-iso10646String _ [] = EmptyImage iso10646String a str = let displayWidth = safeWcswidth str in HorizText a (TL.pack str) displayWidth (length str)
src/Graphics/Vty/Image/Internal.hs view
@@ -66,14 +66,14 @@ -- -- * an empty image of no size or content. data Image = - -- | A horizontal text span is always >= 1 column and has a row height of 1.+ -- | A horizontal text span has a row height of 1. HorizText { attr :: Attr -- | The text to display. The display width of the text is always outputWidth. , displayText :: DisplayText- -- | The number of display columns for the text. Always > 0.+ -- | The number of display columns for the text. , outputWidth :: Int- -- | the number of characters in the text. Always > 0.+ -- | the number of characters in the text. , charWidth :: Int } -- | A horizontal join can be constructed between any two images. However a HorizJoin instance is@@ -82,7 +82,7 @@ | HorizJoin { partLeft :: Image , partRight :: Image- , outputWidth :: Int -- ^ imageWidth partLeft == imageWidth partRight. Always > 1+ , outputWidth :: Int -- ^ imageWidth partLeft == imageWidth partRight. Always > 0 , outputHeight :: Int -- ^ imageHeight partLeft == imageHeight partRight. Always > 0 } -- | A veritical join can be constructed between any two images. However a VertJoin instance is
src/Graphics/Vty/PictureToSpans.hs view
@@ -259,17 +259,19 @@ in addUnclippedText a textStr' else addUnclippedText a textStr addMaybeClipped (VertJoin topImage bottomImage _ow oh) = do- addMaybeClippedJoin "vert_join" skipRows remainingRows rowOffset- (imageHeight topImage)- topImage- bottomImage- oh+ when (imageHeight topImage + imageHeight bottomImage > 0) $+ addMaybeClippedJoin "vert_join" skipRows remainingRows rowOffset+ (imageHeight topImage)+ topImage+ bottomImage+ oh addMaybeClipped (HorizJoin leftImage rightImage ow _oh) = do- addMaybeClippedJoin "horiz_join" skipColumns remainingColumns columnOffset- (imageWidth leftImage)- leftImage- rightImage- ow+ when (imageWidth leftImage + imageWidth rightImage > 0) $+ addMaybeClippedJoin "horiz_join" skipColumns remainingColumns columnOffset+ (imageWidth leftImage)+ leftImage+ rightImage+ ow addMaybeClipped BGFill {outputWidth, outputHeight} = do s <- get let outputWidth' = min (outputWidth - s^.skipColumns) (s^.remainingColumns)@@ -309,7 +311,7 @@ when (state^.remaining <= 0) $ fail $ name ++ " with remaining <= 0" case state^.skip of s -- TODO: check if clipped in other dim. if not use addUnclipped- | s >= size -> fail $ name ++ " on fully clipped"+ | s > size -> put $ state & skip -~ size | s == 0 -> if state^.remaining > i0Dim then do addMaybeClipped i0
vty.cabal view
@@ -1,5 +1,5 @@ name: vty-version: 5.13+version: 5.14 license: BSD3 license-file: LICENSE author: AUTHORS