on master help sign in
Merge pull request #78 from jtdaugherty/master
8c09af0Corey O'Connor
src/Graphics/Vty/Attributes.hs+3−2
@@ -49,7 +49,7 @@ data Attr = Attr
49 { attrStyle :: !(MaybeDefault Style)
49 { attrStyle :: !(MaybeDefault Style)
50 , attrForeColor :: !(MaybeDefault Color)
50 , attrForeColor :: !(MaybeDefault Color)
51 , attrBackColor :: !(MaybeDefault Color)
51 , attrBackColor :: !(MaybeDefault Color)
52− } deriving ( Eq, Show )
52+ } deriving ( Eq, Show, Read )
53
53
54-- This could be encoded into a single 32 bit word. The 32 bit word is first divided
54-- This could be encoded into a single 32 bit word. The 32 bit word is first divided
55-- into 4 groups of 8 bits where: The first group codes what action should be taken with regards to
55-- into 4 groups of 8 bits where: The first group codes what action should be taken with regards to
@@ -103,10 +103,11 @@ data FixedAttr = FixedAttr
103data MaybeDefault v where
103data MaybeDefault v where
104 Default :: MaybeDefault v
104 Default :: MaybeDefault v
105 KeepCurrent :: MaybeDefault v
105 KeepCurrent :: MaybeDefault v
106− SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v
106+ SetTo :: forall v . ( Eq v, Show v, Read v ) => !v -> MaybeDefault v
107
107
108deriving instance Eq v => Eq (MaybeDefault v)
108deriving instance Eq v => Eq (MaybeDefault v)
109deriving instance Eq v => Show (MaybeDefault v)
109deriving instance Eq v => Show (MaybeDefault v)
110+deriving instance (Eq v, Show v, Read v) => Read (MaybeDefault v)
110
111
111instance Eq v => Monoid ( MaybeDefault v ) where
112instance Eq v => Monoid ( MaybeDefault v ) where
112 mempty = KeepCurrent
113 mempty = KeepCurrent
src/Graphics/Vty/Attributes/Color.hs+1−1
@@ -47,5 +47,5 @@ import Data.Word
47--
47--
48-- Seriously, terminal color support is INSANE.
48-- Seriously, terminal color support is INSANE.
49data Color = ISOColor !Word8 | Color240 !Word8
49data Color = ISOColor !Word8 | Color240 !Word8
50− deriving ( Eq, Show )
50+ deriving ( Eq, Show, Read )
51
51
src/Graphics/Vty/Image.hs+2−1
@@ -117,7 +117,8 @@ char a c =
117-- directly to iso10646String or string.
117-- directly to iso10646String or string.
118--
118--
119iso10646String :: Attr -> String -> Image
119iso10646String :: Attr -> String -> Image
120−iso10646String a str =
120+iso10646String _ [] = EmptyImage
121+iso10646String a str =
121 let displayWidth = safeWcswidth str
122 let displayWidth = safeWcswidth str
122 in HorizText a (TL.pack str) displayWidth (length str)
123 in HorizText a (TL.pack str) displayWidth (length str)
123
124