vty 5.1.0 → 5.1.1
raw patch · 7 files changed
+28/−6 lines, 7 files
Files
- CHANGELOG +4/−0
- src/Graphics/Vty/Config.hs +21/−0
- src/Graphics/Vty/Inline/Unsafe.hs +0/−1
- src/Graphics/Vty/Input/Classify.hs +1/−1
- src/Graphics/Vty/Input/Events.hs +0/−2
- src/Graphics/Vty/Input/Loop.hs +1/−1
- vty.cabal +1/−1
CHANGELOG view
@@ -1,3 +1,7 @@+5.1.1+ - merged https://github.com/coreyoconnor/vty/pull/48 thanks sjmielke!+ - jtdaugherty resolved a number of compiler warnings. Thanks!+ 5.1.0 - vmin and vtime can be specified however the application requires. See Graphics.Vty.Config. - fixed the processing of input when vmin is set > 1.
src/Graphics/Vty/Config.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE KindSignatures #-} -- | A 'Config' can be provided to mkVty to customize the applications use of vty. A config file can -- be used to customize vty for a user's system. --@@ -173,6 +174,9 @@ configLexer :: Stream s m Char => P.GenTokenParser s u m configLexer = P.makeTokenParser configLanguage +mapDecl :: forall s u (m :: * -> *).+ (Monad m, Stream s (WriterT Config m) Char) =>+ ParsecT s u (WriterT Config m) () mapDecl = do void $ string "map" P.whiteSpace configLexer@@ -185,6 +189,9 @@ -- TODO: Generated by a vim macro. There is a better way here. Derive parser? Use Read -- instance? Generics?+parseKey :: forall s u (m :: * -> *).+ Stream s m Char =>+ ParsecT s u m Key parseKey = do key <- P.identifier configLexer case key of@@ -215,8 +222,14 @@ "KMenu" -> return KMenu _ -> fail $ key ++ " is not a valid key identifier" +parseModifiers :: forall s u (m :: * -> *).+ Stream s m Char =>+ ParsecT s u m [Modifier] parseModifiers = P.brackets configLexer (parseModifier `sepBy` P.symbol configLexer ",") +parseModifier :: forall s u (m :: * -> *).+ Stream s m Char =>+ ParsecT s u m Modifier parseModifier = do m <- P.identifier configLexer case m of@@ -226,14 +239,22 @@ "MAlt" -> return MAlt _ -> fail $ m ++ " is not a valid modifier identifier" +debugLogDecl :: forall s u (m :: * -> *).+ (Monad m, Stream s (WriterT Config m) Char) =>+ ParsecT s u (WriterT Config m) () debugLogDecl = do void $ string "debugLog" P.whiteSpace configLexer path <- P.stringLiteral configLexer lift $ tell $ def { debugLog = Just path } +ignoreLine :: forall s u (m :: * -> *).+ Stream s m Char => ParsecT s u m () ignoreLine = void $ manyTill anyChar newline +parseConfig :: forall s u (m :: * -> *).+ (Monad m, Stream s (WriterT Config m) Char) =>+ ParsecT s u (WriterT Config m) () parseConfig = void $ many $ do P.whiteSpace configLexer let directives = [mapDecl, debugLogDecl]
src/Graphics/Vty/Inline/Unsafe.hs view
@@ -2,7 +2,6 @@ module Graphics.Vty.Inline.Unsafe where import Graphics.Vty-import Graphics.Vty.Config (userConfig) import Data.Default import Data.IORef
src/Graphics/Vty/Input/Classify.hs view
@@ -12,7 +12,7 @@ import Codec.Binary.UTF8.Generic (decode) -import Data.List(tails,inits)+import Data.List(inits) import qualified Data.Map as M( fromList, lookup ) import Data.Maybe ( mapMaybe ) import qualified Data.Set as S( fromList, member )
src/Graphics/Vty/Input/Events.hs view
@@ -1,7 +1,5 @@ module Graphics.Vty.Input.Events where -import Data.Map (Map)- -- | Representations of non-modifier keys. -- -- * KFun is indexed from 0 to 63. Range of supported FKeys varies by terminal and keyboard.
src/Graphics/Vty/Input/Loop.hs view
@@ -177,7 +177,7 @@ Nothing -> return () Just h -> do config <- readIORef $ _configRef input- hPrintf h "initial (vmin,vtime): %s\n" (show (vmin config, vtime config))+ _ <- hPrintf h "initial (vmin,vtime): %s\n" (show (vmin config, vtime config)) forM_ classifyTable $ \i -> case i of (inBytes, EvKey k mods) -> hPrintf h "map %s %s %s %s\n" (show termName) (show inBytes)
vty.cabal view
@@ -1,5 +1,5 @@ name: vty-version: 5.1.0+version: 5.1.1 license: BSD3 license-file: LICENSE author: AUTHORS