vty 5.23.1 → 5.24
raw patch · 7 files changed
+26/−65 lines, 7 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +6/−0
- src/Graphics/Vty/Attributes.hs +10/−1
- src/Graphics/Vty/Attributes/Color.hs +5/−1
- src/Graphics/Vty/Image/Internal.hs +1/−27
- src/Graphics/Vty/Output/Interface.hs +1/−2
- test/VerifyAttributeOps.hs +0/−9
- vty.cabal +3/−25
CHANGELOG.md view
@@ -1,3 +1,9 @@++5.24+ - Add Generic and NFData instances for some types+ - Image: remove custom Show instance, add derived Show and Read instances+ - Updated Travis build settings (thanks Eric Mertens)+ 5.23.1 - Fixed a bug where italics did not combine properly with other display modes (#155, thanks Eric Mertens)
src/Graphics/Vty/Attributes.hs view
@@ -2,6 +2,8 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DeriveAnyClass #-} -- | Display attributes --@@ -61,12 +63,14 @@ ) where +import Control.DeepSeq import Data.Bits #if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup #endif import Data.Text (Text) import Data.Word+import GHC.Generics import Graphics.Vty.Attributes.Color import Graphics.Vty.Attributes.Color240@@ -83,7 +87,7 @@ , attrForeColor :: !(MaybeDefault Color) , attrBackColor :: !(MaybeDefault Color) , attrURL :: !(MaybeDefault Text)- } deriving ( Eq, Show, Read )+ } deriving ( Eq, Show, Read, Generic, NFData ) -- This could be encoded into a single 32 bit word. The 32 bit word is -- first divided into 4 groups of 8 bits where: The first group codes@@ -148,6 +152,11 @@ Default :: MaybeDefault v KeepCurrent :: MaybeDefault v SetTo :: forall v . ( Eq v, Show v, Read v ) => !v -> MaybeDefault v++instance (NFData v) => NFData (MaybeDefault v) where+ rnf Default = ()+ rnf KeepCurrent = ()+ rnf (SetTo v) = rnf v deriving instance Eq v => Eq (MaybeDefault v) deriving instance Eq v => Show (MaybeDefault v)
src/Graphics/Vty/Attributes/Color.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DeriveAnyClass #-} module Graphics.Vty.Attributes.Color ( Color(..) , black@@ -20,6 +22,8 @@ where import Data.Word+import GHC.Generics+import Control.DeepSeq -- | Abstract data type representing a color. --@@ -74,7 +78,7 @@ -- -- Seriously, terminal color support is INSANE. data Color = ISOColor !Word8 | Color240 !Word8- deriving ( Eq, Show, Read )+ deriving ( Eq, Show, Read, Generic, NFData ) -- | Standard 8-color ANSI terminal color codes. black, red, green, yellow, blue, magenta, cyan, white :: Color
src/Graphics/Vty/Image/Internal.hs view
@@ -142,33 +142,7 @@ -- -- Any image of zero size equals the empty image. | EmptyImage- deriving (Eq, Generic)--instance Show Image where- show ( HorizText { attr, displayText, outputWidth, charWidth } )- = "HorizText " ++ show displayText- ++ "@(" ++ show attr ++ ","- ++ show outputWidth ++ ","- ++ show charWidth ++ ")"- show ( BGFill { outputWidth, outputHeight } )- = "BGFill (" ++ show outputWidth ++ "," ++ show outputHeight ++ ")"- show ( HorizJoin { partLeft = l, partRight = r, outputWidth = c } )- = "HorizJoin " ++ show c ++ " (" ++ show l ++ " <|> " ++ show r ++ ")"- show ( VertJoin { partTop = t, partBottom = b, outputWidth = c, outputHeight = r } )- = "VertJoin [" ++ show c ++ ", " ++ show r ++ "] (" ++ show t ++ ") <-> (" ++ show b ++ ")"- show ( CropRight { croppedImage, outputWidth, outputHeight } )- = "CropRight [" ++ show outputWidth ++ "," ++ show outputHeight ++ "]"- ++ " (" ++ show croppedImage ++ ")"- show ( CropLeft { croppedImage, leftSkip, outputWidth, outputHeight } )- = "CropLeft [" ++ show leftSkip ++ "," ++ show outputWidth ++ "," ++ show outputHeight ++ "]"- ++ " (" ++ show croppedImage ++ ")"- show ( CropBottom { croppedImage, outputWidth, outputHeight } )- = "CropBottom [" ++ show outputWidth ++ "," ++ show outputHeight ++ "]"- ++ " (" ++ show croppedImage ++ ")"- show ( CropTop { croppedImage, topSkip, outputWidth, outputHeight } )- = "CropTop [" ++ show topSkip ++ "," ++ show outputWidth ++ "," ++ show outputHeight ++ "]"- ++ " (" ++ show croppedImage ++ ")"- show ( EmptyImage ) = "EmptyImage"+ deriving (Eq, Generic, Show, Read) -- | pretty print just the structure of an image. ppImageStructure :: Image -> String
src/Graphics/Vty/Output/Interface.hs view
@@ -177,8 +177,7 @@ Nothing -> replicate (fromEnum $ regionHeight $ affectedRegion ops) True Just previousOps -> if affectedRegion previousOps /= affectedRegion ops then replicate (displayOpsRows ops) True- else zipWith (/=) (Vector.toList previousOps)- (Vector.toList ops)+ else Vector.toList $ Vector.zipWith (/=) previousOps ops -- build the Write corresponding to the output image out = (if manipCursor then writeHideCursor dc else mempty) `mappend` writeOutputOps urlsEnabled dc initialAttr diffs ops
− test/VerifyAttributeOps.hs
@@ -1,9 +0,0 @@-module VerifyAttributeOps where--import Verify.Graphics.Vty.Attributes--import Verify--tests :: IO [Test]-tests = return []-
vty.cabal view
@@ -1,5 +1,5 @@ name: vty-version: 5.23.1+version: 5.24 license: BSD3 license-file: LICENSE author: AUTHORS@@ -24,13 +24,13 @@ © Corey O'Connor; BSD3 license. . © Jonathan Daugherty; BSD3 license.-cabal-version: >= 1.18+cabal-version: 1.18 build-type: Simple extra-doc-files: README.md, AUTHORS, CHANGELOG.md, LICENSE-tested-with: GHC >= 7.6.2+tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3 source-repository head type: git@@ -118,8 +118,6 @@ ghc-prof-options: -O2 -funbox-strict-fields -caf-all -Wall -fspec-constr -fspec-constr-count=10 - cc-options: -O2- executable vty-mode-demo main-is: ModeDemo.hs hs-source-dirs: demos@@ -149,26 +147,6 @@ microlens, microlens-mtl, mtl >= 1.1.1.0 && < 2.3--test-suite verify-attribute-ops- default-language: Haskell2010- default-extensions: ScopedTypeVariables- type: detailed-0.9- hs-source-dirs: test- test-module: VerifyAttributeOps- build-depends: vty,- Cabal >= 1.20,- QuickCheck >= 2.7,- random >= 1.0 && < 1.2,- base >= 4.8 && < 5,- bytestring,- containers,- deepseq >= 1.1 && < 1.5,- mtl >= 1.1.1.0 && < 2.3,- text >= 0.11.3,- unix,- utf8-string >= 0.3 && < 1.1,- vector >= 0.7 test-suite verify-using-mock-terminal default-language: Haskell2010