vty 5.4.0 → 5.5.0
raw patch · 21 files changed
+69/−98 lines, 21 filesdep +microlensdep +microlens-mtldep +microlens-thdep −lens
Dependencies added: microlens, microlens-mtl, microlens-th
Dependencies removed: lens
Files
- CHANGELOG +14/−9
- README.md +10/−0
- dist/build/verify-attribute-opsStub/verify-attribute-opsStub-tmp/verify-attribute-opsStub.hs +0/−5
- dist/build/verify-crop-span-generationStub/verify-crop-span-generationStub-tmp/verify-crop-span-generationStub.hs +0/−5
- dist/build/verify-display-attributesStub/verify-display-attributesStub-tmp/verify-display-attributesStub.hs +0/−5
- dist/build/verify-empty-image-propsStub/verify-empty-image-propsStub-tmp/verify-empty-image-propsStub.hs +0/−5
- dist/build/verify-eval-terminfo-capsStub/verify-eval-terminfo-capsStub-tmp/verify-eval-terminfo-capsStub.hs +0/−5
- dist/build/verify-image-opsStub/verify-image-opsStub-tmp/verify-image-opsStub.hs +0/−5
- dist/build/verify-image-transStub/verify-image-transStub-tmp/verify-image-transStub.hs +0/−5
- dist/build/verify-inlineStub/verify-inlineStub-tmp/verify-inlineStub.hs +0/−5
- dist/build/verify-layers-span-generationStub/verify-layers-span-generationStub-tmp/verify-layers-span-generationStub.hs +0/−5
- dist/build/verify-parse-terminfo-capsStub/verify-parse-terminfo-capsStub-tmp/verify-parse-terminfo-capsStub.hs +0/−5
- dist/build/verify-simple-span-generationStub/verify-simple-span-generationStub-tmp/verify-simple-span-generationStub.hs +0/−5
- dist/build/verify-terminalStub/verify-terminalStub-tmp/verify-terminalStub.hs +0/−5
- dist/build/verify-using-mock-terminalStub/verify-using-mock-terminalStub-tmp/verify-using-mock-terminalStub.hs +0/−5
- dist/build/verify-utf8-widthStub/verify-utf8-widthStub-tmp/verify-utf8-widthStub.hs +0/−5
- src/Graphics/Vty/Input.hs +1/−1
- src/Graphics/Vty/Input/Loop.hs +11/−1
- src/Graphics/Vty/PictureToSpans.hs +9/−1
- test/VerifyUsingMockInput.hs +1/−1
- vty.cabal +23/−15
CHANGELOG view
@@ -1,3 +1,9 @@+5.5.0+ - Replaced lens dependency with microlens, microlens-mtl, microlens-th dependencies. Issue #90+ - Thanks Jonathan Daugherty+ - Cabal corrections.+ - Thanks Lennart Spitzner+ 5.4.0 - Changed eventChannel of Graphics.Vty.Input from Chan to TChan. This enables clients to query if there are no pending events. The Graphics.Vty interface nextEvent is unchanged. Clients that use@@ -92,7 +98,7 @@ - removed: derivedVtime, derivedVmin, inputForCurrentTerminal, inputForNameAndIO, outputForCurrentTerminal, outputForNameAndIO - added: inputForConfig, outputForConfig- - updates to vty-rogue from jtdaugherty. Thanks! + - updates to vty-rogue from jtdaugherty. Thanks! - the oldest version of GHC tested to support vty is 7.6.2. - the oldest version of GHC that vty compiles under is 7.4.2 @@ -190,8 +196,8 @@ - put_attr_change applies a display attribute change immediately to a terminal - For instance, can be used to change the display attrbiutes of text output via putStrLn and putStr. EX: "put_attr_change $ back_color red" will set the- background color to red. - - Changes do not apply to a Picture output via output_picture. + background color to red.+ - Changes do not apply to a Picture output via output_picture. - See Graphics.Vty.Inline - Moved all IO actions into any monad an instance of MonadIO @@ -231,11 +237,11 @@ enough. - The details required to display the desired picture on a terminal are well encapsulated. - Terminfo based display terminal implementation. With specialized derivitives for xterm,- Terminal.app, and iTerm.app. + Terminal.app, and iTerm.app. - Attempts to robustly handle even terminals that don't support all display attributes. - I've tested the following terminals with success: iTerm.app, Terminal.app, xterm, rxvt, mlterm, Eterm, gnome-terminal, konsole, screen, linux vty. Hopefully you will be- as successfull. + as successfull. - Improved unicode support. Double wide characters will display as expected. - 256 color support. See Graphics.Vty.Attributes.Color240. The actual output color is adjusted according to the number of colors the terminal supports.@@ -251,10 +257,9 @@ - http://trac.haskell.org/vty/ticket/14 - "Multi-byte characters are not displayed correctly on update" - http://trac.haskell.org/vty/ticket/10- - "Redraw does not handle rendering a line that extends beyond screen width characters" + - "Redraw does not handle rendering a line that extends beyond screen width characters" - http://trac.haskell.org/vty/ticket/13- - "The <|> and <-> combinators should be more forgiving of mismatched dimensions" + - "The <|> and <-> combinators should be more forgiving of mismatched dimensions" - http://trac.haskell.org/vty/ticket/9- - "256-color support" + - "256-color support" - http://trac.haskell.org/vty/ticket/19-
README.md view
@@ -83,12 +83,22 @@ ## Under NixOS +### Using cabal+ After installing ncurses to user env. ~~~ LIBRARY_PATH=$HOME/.nix-profile/lib/ cabal configure --enable-tests --extra-lib-dirs=$HOME/.nix-profile/lib LIBRARY_PATH=$HOME/.nix-profile/lib/ cabal build LIBRARY_PATH=$HOME/.nix-profile/lib/ cabal test+~~~++### Using stack++~~~+stack build+stack test+stack install ~~~ ## Coverage
− dist/build/verify-attribute-opsStub/verify-attribute-opsStub-tmp/verify-attribute-opsStub.hs
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-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
@@ -1,5 +0,0 @@-module Main ( main ) where-import Distribution.Simple.Test.LibV09 ( stubMain )-import VerifyUtf8Width ( tests )-main :: IO ()-main = stubMain tests
src/Graphics/Vty/Input.hs view
@@ -137,7 +137,7 @@ import Graphics.Vty.Input.Terminfo import Control.Concurrent.STM-import Control.Lens+import Lens.Micro import qualified System.Console.Terminfo as Terminfo import System.Posix.Signals.Exts
src/Graphics/Vty/Input/Loop.hs view
@@ -21,10 +21,14 @@ import Control.Concurrent import Control.Concurrent.STM import Control.Exception (mask, try, SomeException)-import Control.Lens+import Data.Monoid+import Lens.Micro+import Lens.Micro.Mtl+import Lens.Micro.TH import Control.Monad (when, mzero, forM_) import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.State (StateT(..), evalStateT)+import Control.Monad.State.Class (MonadState, modify) import Control.Monad.Trans.Reader (ReaderT(..)) import Data.Char@@ -212,3 +216,9 @@ forkOSFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId forkOSFinally action and_then = mask $ \restore -> forkOS $ try (restore action) >>= and_then++(<>=) :: (MonadState s m, Monoid a) => ASetter' s a -> a -> m ()+l <>= a = modify (l <>~ a)++(<>~) :: Monoid a => ASetter s t a a -> a -> s -> t+l <>~ n = over l (`mappend` n)
src/Graphics/Vty/PictureToSpans.hs view
@@ -21,7 +21,9 @@ import Graphics.Vty.Picture import Graphics.Vty.Span -import Control.Lens hiding ( op )+import Lens.Micro+import Lens.Micro.Mtl+import Lens.Micro.TH import Control.Monad.Reader import Control.Monad.State.Strict hiding ( state ) @@ -355,3 +357,9 @@ when (spanOpsEffectedColumns ops' > regionWidth theRegion) $ fail $ "row " ++ show row ++ " now exceeds region width" MVector.write theMrowOps row ops'++(-~) :: Num a => ASetter s t a a -> a -> s -> t+l -~ n = over l (subtract n)++(+~) :: Num a => ASetter s t a a -> a -> s -> t+l +~ n = over l (n +)
test/VerifyUsingMockInput.hs view
@@ -16,7 +16,7 @@ import Control.Concurrent import Control.Concurrent.STM import Control.Exception-import Control.Lens ((^.))+import Lens.Micro ((^.)) import Control.Monad import Data.Default
vty.cabal view
@@ -1,5 +1,5 @@ name: vty-version: 5.4.0+version: 5.5.0 license: BSD3 license-file: LICENSE author: AUTHORS@@ -43,6 +43,10 @@ LICENSE tested-with: GHC >= 7.6.2 +source-repository head+ type: git+ location: https://github.com/coreyoconnor/vty.git+ library default-language: Haskell2010 build-depends: base >= 4 && < 5,@@ -53,7 +57,9 @@ deepseq >= 1.1 && < 1.5, directory, filepath >= 1.0 && < 2.0,- lens >= 3.9.0.2 && < 5.0,+ microlens,+ microlens-mtl,+ microlens-th, -- required for nice installation with yi hashable >= 1.2, mtl >= 1.1.1.0 && < 2.3,@@ -113,9 +119,9 @@ default-extensions: ScopedTypeVariables ForeignFunctionInterface - ghc-options: -O2 -funbox-strict-fields -threaded -Wall -fspec-constr -fspec-constr-count=10+ ghc-options: -O2 -funbox-strict-fields -Wall -fspec-constr -fspec-constr-count=10 - ghc-prof-options: -O2 -funbox-strict-fields -threaded -caf-all -Wall -fspec-constr -fspec-constr-count=10+ ghc-prof-options: -O2 -funbox-strict-fields -caf-all -Wall -fspec-constr -fspec-constr-count=10 cc-options: -O2 @@ -130,7 +136,8 @@ base >= 4 && < 5, containers, data-default >= 0.5.3,- lens,+ microlens,+ microlens-mtl, mtl >= 1.1.1.0 && < 2.3 test-suite verify-attribute-ops@@ -185,7 +192,7 @@ unix, utf8-string >= 0.3 && < 1.1, vector >= 0.7- + test-suite verify-terminal default-language: Haskell2010 default-extensions: ScopedTypeVariables@@ -418,7 +425,7 @@ unix, utf8-string >= 0.3 && < 1.1, vector >= 0.7- + test-suite verify-simple-span-generation default-language: Haskell2010 default-extensions: ScopedTypeVariables@@ -449,8 +456,8 @@ unix, utf8-string >= 0.3 && < 1.1, vector >= 0.7- - ++ test-suite verify-crop-span-generation default-language: Haskell2010 default-extensions: ScopedTypeVariables@@ -481,8 +488,8 @@ unix, utf8-string >= 0.3 && < 1.1, vector >= 0.7- + test-suite verify-layers-span-generation default-language: Haskell2010 default-extensions: ScopedTypeVariables@@ -539,7 +546,7 @@ unix, utf8-string >= 0.3 && < 1.1, vector >= 0.7- + test-suite verify-using-mock-input default-language: Haskell2010 default-extensions: ScopedTypeVariables@@ -563,7 +570,8 @@ bytestring, containers, deepseq >= 1.1 && < 1.5,- lens >= 3.9.0.2 && < 5.0,+ microlens,+ microlens-mtl, mtl >= 1.1.1.0 && < 2.3, stm, terminfo >= 0.3 && < 0.5,@@ -571,7 +579,7 @@ unix, utf8-string >= 0.3 && < 1.1, vector >= 0.7- + ghc-options: -threaded -Wall test-suite verify-config@@ -599,7 +607,8 @@ bytestring, containers, deepseq >= 1.1 && < 1.5,- lens >= 3.9.0.2 && < 5.0,+ microlens,+ microlens-mtl, mtl >= 1.1.1.0 && < 2.3, string-qq, terminfo >= 0.3 && < 0.5,@@ -609,4 +618,3 @@ vector >= 0.7 ghc-options: -threaded -Wall-