on master help sign in
Merge branch 'master' of github.com:coreyoconnor/vty
commitb1425c68c6c05a8c000f5acff844aeff027a32a0 authorJonathan Daugherty <cygnus@foobox.com> dateSun 28 Aug 2016, 09:49 (10 years ago) parent89e537b84ed03e
4 files changed+15−4
CHANGELOG+5 src/Graphics/Vty/Input/Events.hs+6−2 src/Graphics/Vty/Input/Paste.hs+3−1 vty.cabal+1−1
CHANGELOG+5
@@ -1,3 +1,8 @@
1+5.8
2+ - API change: EvPaste input event now provides paste data as a raw
3+ ByteString rather than a String to allow the application to decode
4+ how best to decode it
5+
165.7.1
27 - ModeDemo: added an explicit Control.Applicative import for older GHCs
38
src/Graphics/Vty/Input/Events.hs+6−2
@@ -1,5 +1,7 @@
11module Graphics.Vty.Input.Events where
22
3+import Data.ByteString
4+
35-- | Representations of non-modifier keys.
46--
57-- * KFun is indexed from 0 to 63. Range of supported FKeys varies by terminal and keyboard.
@@ -42,12 +44,14 @@ data Event
4244 -- signal. If read from 'nextEvent' this is the size at the time the
4345 -- event was processed by Vty. Typically these are the same, but if
4446 -- somebody is resizing the terminal quickly they can be different.
45− | EvPaste String
47+ | EvPaste ByteString
4648 -- ^ A paste event occurs when a bracketed paste input sequence is
4749 -- received. For terminals that support bracketed paste mode, these
4850 -- events will be triggered on a paste event. Terminals that do not
4951 -- support bracketed pastes will send the paste contents as ordinary
50− -- input (which is probably bad, so beware!)
52+ -- input (which is probably bad, so beware!) Note that the data is
53+ -- provided in raw form and you'll have to decode (e.g. as UTF-8) if
54+ -- that's what your application expects.
5155 deriving (Eq,Show,Read,Ord)
5256
5357type ClassifyMap = [(String,Event)]
src/Graphics/Vty/Input/Paste.hs+3−1
@@ -7,6 +7,8 @@ module Graphics.Vty.Input.Paste
77 , bracketedPasteFinished
88 ) where
99
10+import qualified Data.ByteString.Char8 as BS8
11+
1012import Graphics.Vty.Input.Events
1113import Graphics.Vty.Input.Classify.Types
1214
@@ -35,7 +37,7 @@ parseBracketedPaste s =
3537 rest' = if bracketedPasteEnd `isPrefixOf` rest
3638 then drop (length bracketedPasteEnd) rest
3739 else rest
38− in Valid (EvPaste p) rest'
40+ in Valid (EvPaste $ BS8.pack p) rest'
3941
4042takeUntil :: (Eq a) => [a] -> [a] -> ([a],[a])
4143takeUntil [] _ = ([], [])
vty.cabal+1−1
@@ -1,5 +1,5 @@
11name: vty
2−version: 5.7.1
2+version: 5.8
33license: BSD3
44license-file: LICENSE
55author: AUTHORS