on master help sign in
Library-wide trailing whitespace cleanup
commitba2b6356eaa43b3339b48fba84851346bd93b9e9 authorJonathan Daugherty <cygnus@foobox.com> dateSat 21 Jan 2017, 22:21 (10 years ago) parenta69c4b8
49 files changed+291−316
src/Codec/Binary/UTF8/Debug.hs+1−1 src/Data/Sequence/Extra.hs+2−2 src/Data/Terminfo/Eval.hs+2−3 src/Data/Terminfo/Parse.hs+30−31 src/Graphics/Text/Width.hs+1−1 src/Graphics/Vty.hs+6−7 src/Graphics/Vty/Attributes.hs+3−4 src/Graphics/Vty/Attributes/Color.hs+3−4 src/Graphics/Vty/Attributes/Color240.hs+1−1 src/Graphics/Vty/Config.hs+2−2 src/Graphics/Vty/Debug.hs+3−4 src/Graphics/Vty/Debug/Image.hs+1−1 src/Graphics/Vty/DisplayAttributes.hs+1−1 src/Graphics/Vty/Image.hs+10−11 src/Graphics/Vty/Image/Internal.hs+6−7 src/Graphics/Vty/Inline.hs+5−5 src/Graphics/Vty/Input.hs+2−2 src/Graphics/Vty/Input/Classify.hs+1−1 src/Graphics/Vty/Input/Loop.hs+1−1 src/Graphics/Vty/Input/Terminfo.hs+2−2 src/Graphics/Vty/Input/Terminfo/ANSIVT.hs+3−4 src/Graphics/Vty/Output/Interface.hs+18−18 src/Graphics/Vty/Output/TerminfoBased.hs+25−26 src/Graphics/Vty/Output/XTermColor.hs+1−2 src/Graphics/Vty/Picture.hs+5−5 src/Graphics/Vty/PictureToSpans.hs+4−4 src/Graphics/Vty/Span.hs+3−5 test/BenchNoDiffOpt.hs+2−2 test/BenchRenderChar.hs+1−1 test/BenchVerticalScroll.hs+3−4 test/ControlTable.hs+1−1 test/Issue18.hs+3−4 test/Makefile+2−2 test/Verify.hs+3−4 test/Verify/Data/Terminfo/Parse.hs+12−13 test/Verify/Graphics/Vty/Attributes.hs+2−3 test/Verify/Graphics/Vty/Image.hs+10−11 test/Verify/Graphics/Vty/Output.hs+1−2 test/Verify/Graphics/Vty/Picture.hs+8−9 test/Verify/Graphics/Vty/Span.hs+1−2 test/VerifyCropSpanGeneration.hs+2−3 test/VerifyEvalTerminfoCaps.hs+9−9 test/VerifyImageOps.hs+25−26 test/VerifyImageTrans.hs+1−1 test/VerifyLayersSpanGeneration.hs+2−2 test/VerifyParseTerminfoCaps.hs+3−4 test/VerifySimpleSpanGeneration.hs+8−8 test/VerifyUsingMockTerminal.hs+1−1 test/interactive_terminal_test.hs+49−49
src/Codec/Binary/UTF8/Debug.hs+1−1
@@ -1,6 +1,6 @@
11{-# OPTIONS_HADDOCK hide #-}
22-- Copyright 2009 Corey O'Connor
3−module Codec.Binary.UTF8.Debug
3+module Codec.Binary.UTF8.Debug
44 where
55
66import Codec.Binary.UTF8.String ( encode )
src/Data/Sequence/Extra.hs+2−2
@@ -7,7 +7,7 @@ import Data.Sequence
77import Control.Parallel.Strategies
88
99instance NFData a => NFData (Seq a) where
10− rnf = \v -> rnf' (viewl v)
11− where
10+ rnf = \v -> rnf' (viewl v)
11+ where
1212 rnf' EmptyL = ()
1313 rnf' (a :< r) = rnf a >| rnf' (viewl r)
src/Data/Terminfo/Eval.hs+2−3
@@ -83,7 +83,7 @@ writeCapOp DecOut = do
8383 p <- pop
8484 forM_ (show p) $ tell.writeWord8.toEnum.fromEnum
8585writeCapOp CharOut = do
86− pop >>= tell.writeWord8.toEnum.fromEnum
86+ pop >>= tell.writeWord8.toEnum.fromEnum
8787writeCapOp (PushParam pn) = do
8888 readParam pn >>= push
8989writeCapOp (PushValue v) = do
@@ -91,7 +91,7 @@ writeCapOp (PushValue v) = do
9191writeCapOp (Conditional expr parts) = do
9292 writeCapOps expr
9393 writeContitionalParts parts
94− where
94+ where
9595 writeContitionalParts [] = return ()
9696 writeContitionalParts ((trueOps, falseOps) : falseParts) = do
9797 -- (man 5 terminfo)
@@ -137,4 +137,3 @@ writeCapOp CompareGt = do
137137 v1 <- pop
138138 v0 <- pop
139139 push $ if v0 > v1 then 1 else 0
140−
src/Data/Terminfo/Parse.hs+30−31
@@ -46,13 +46,13 @@ instance Show CapExpression where
4646 hexDump = foldr (\b s -> showHex b s) ""
4747
4848instance NFData CapExpression where
49− rnf (CapExpression ops !_bytes !str !c !pOps)
49+ rnf (CapExpression ops !_bytes !str !c !pOps)
5050 = rnf ops `seq` rnf str `seq` rnf c `seq` rnf pOps
5151
5252type CapParam = Word
5353
5454type CapOps = [CapOp]
55−data CapOp =
55+data CapOp =
5656 Bytes !Int !Int -- offset count
5757 | DecOut | CharOut
5858 -- This stores a 0-based index to the parameter. However the operation that implies this op is
@@ -60,7 +60,7 @@ data CapOp =
6060 | PushParam !Word | PushValue !Word
6161 -- The conditional parts are the sequence of (%t expression, %e expression) pairs.
6262 -- The %e expression may be NOP
63− | Conditional
63+ | Conditional
6464 { conditionalExpr :: !CapOps
6565 , conditionalParts :: ![(CapOps, CapOps)]
6666 }
@@ -72,8 +72,8 @@ data CapOp =
7272instance NFData CapOp where
7373 rnf (Bytes offset byteCount ) = rnf offset `seq` rnf byteCount
7474 rnf (PushParam pn) = rnf pn
75− rnf (PushValue v) = rnf v
76− rnf (Conditional cExpr cParts) = rnf cExpr `seq` rnf cParts
75+ rnf (PushValue v) = rnf v
76+ rnf (Conditional cExpr cParts) = rnf cExpr `seq` rnf cParts
7777 rnf BitwiseOr = ()
7878 rnf BitwiseXOr = ()
7979 rnf BitwiseAnd = ()
@@ -94,11 +94,11 @@ instance NFData ParamOp where
9494 rnf IncFirstTwo = ()
9595
9696parseCapExpression :: String -> Either ParseError CapExpression
97−parseCapExpression capString =
97+parseCapExpression capString =
9898 let v = runParser capExpressionParser
9999 initialBuildState
100− "terminfo cap"
101− capString
100+ "terminfo cap"
101+ capString
102102 in case v of
103103 Left e -> Left e
104104 Right buildResults -> Right $ constructCapExpression capString buildResults
@@ -113,21 +113,21 @@ constructCapExpression capString buildResults =
113113 , sourceString = capString
114114 , paramCount = outParamCount buildResults
115115 , paramOps = outParamOps buildResults
116− }
116+ }
117117 in rnf expr `seq` expr
118118
119−type CapParser a = Parsec String BuildState a
119+type CapParser a = Parsec String BuildState a
120120
121121capExpressionParser :: CapParser BuildResults
122122capExpressionParser = do
123− rs <- many $ paramEscapeParser <|> bytesOpParser
123+ rs <- many $ paramEscapeParser <|> bytesOpParser
124124 return $ mconcat rs
125125
126126paramEscapeParser :: CapParser BuildResults
127127paramEscapeParser = do
128128 _ <- char '%'
129129 incOffset 1
130− literalPercentParser <|> paramOpParser
130+ literalPercentParser <|> paramOpParser
131131
132132literalPercentParser :: CapParser BuildResults
133133literalPercentParser = do
@@ -138,7 +138,7 @@ literalPercentParser = do
138138
139139paramOpParser :: CapParser BuildResults
140140paramOpParser
141− = incrementOpParser
141+ = incrementOpParser
142142 <|> pushOpParser
143143 <|> decOutParser
144144 <|> charOutParser
@@ -179,16 +179,16 @@ conditionalOpParser = do
179179 _ <- char '?'
180180 incOffset 1
181181 condPart <- manyExpr conditionalTrueParser
182− parts <- manyP
182+ parts <- manyP
183183 ( do
184184 truePart <- manyExpr $ choice [ try $ lookAhead conditionalEndParser
185− , conditionalFalseParser
185+ , conditionalFalseParser
186186 ]
187187 falsePart <- manyExpr $ choice [ try $ lookAhead conditionalEndParser
188188 , conditionalTrueParser
189189 ]
190190 return ( truePart, falsePart )
191− )
191+ )
192192 conditionalEndParser
193193
194194 let trueParts = map fst parts
@@ -208,10 +208,10 @@ conditionalOpParser = do
208208
209209 return $ BuildResults n'' [ Conditional cond condParts ] pOps
210210
211− where
212− manyP !p !end = choice
211+ where
212+ manyP !p !end = choice
213213 [ try end >> return []
214− , do !v <- p
214+ , do !v <- p
215215 !vs <- manyP p end
216216 return $! v : vs
217217 ]
@@ -233,7 +233,7 @@ conditionalEndParser = do
233233 incOffset 2
234234
235235bitwiseOpParser :: CapParser BuildResults
236−bitwiseOpParser
236+bitwiseOpParser
237237 = bitwiseOrParser
238238 <|> bitwiseAndParser
239239 <|> bitwiseXorParser
@@ -257,9 +257,9 @@ bitwiseXorParser = do
257257 return $ BuildResults 0 [ BitwiseXOr ] [ ]
258258
259259arithOpParser :: CapParser BuildResults
260−arithOpParser
261− = plusOp
262− <|> minusOp
260+arithOpParser
261+ = plusOp
262+ <|> minusOp
263263 where
264264 plusOp = do
265265 _ <- char '+'
@@ -282,10 +282,10 @@ literalIntOpParser = do
282282 return $ BuildResults 0 [ PushValue n ] [ ]
283283
284284compareOpParser :: CapParser BuildResults
285−compareOpParser
285+compareOpParser
286286 = compareEqOp
287− <|> compareLtOp
288− <|> compareGtOp
287+ <|> compareLtOp
288+ <|> compareGtOp
289289 where
290290 compareEqOp = do
291291 _ <- char '='
@@ -313,14 +313,14 @@ bytesOpParser = do
313313charConstParser :: CapParser BuildResults
314314charConstParser = do
315315 _ <- char '\''
316− charValue <- liftM (toEnum . fromEnum) anyChar
316+ charValue <- liftM (toEnum . fromEnum) anyChar
317317 _ <- char '\''
318318 incOffset 3
319319 return $ BuildResults 0 [ PushValue charValue ] [ ]
320320
321−data BuildState = BuildState
321+data BuildState = BuildState
322322 { nextOffset :: Int
323− }
323+ }
324324
325325incOffset :: Int -> CapParser ()
326326incOffset n = do
@@ -339,10 +339,9 @@ data BuildResults = BuildResults
339339
340340instance Monoid BuildResults where
341341 mempty = BuildResults 0 [] []
342− v0 `mappend` v1
342+ v0 `mappend` v1
343343 = BuildResults
344344 { outParamCount = (outParamCount v0) `max` (outParamCount v1)
345345 , outCapOps = (outCapOps v0) `mappend` (outCapOps v1)
346346 , outParamOps = (outParamOps v0) `mappend` (outParamOps v1)
347347 }
348−
src/Graphics/Text/Width.hs+1−1
@@ -14,7 +14,7 @@ wcswidth :: String -> Int
1414wcswidth = sum . map wcwidth
1515
1616-- XXX: Characters with unknown widths occupy 1 column?
17−--
17+--
1818-- Not sure if this is actually correct. I presume there is a replacement character that is output
1919-- by the terminal instead of the character and this replacement character is 1 column wide. If this
2020-- is not true for all terminals then a per-terminal replacement character width needs to be
src/Graphics/Vty.hs+6−7
@@ -10,7 +10,7 @@
1010-- - The constructors in "Graphics.Vty.Image.Internal" should not be used.
1111--
1212-- - 'Image's can be styled using 'Attr'. See "Graphics.Vty.Attributes".
13−--
13+--
1414-- See the vty-examples package for a number of examples.
1515--
1616-- @
@@ -28,7 +28,7 @@
2828-- 'shutdown' vty
2929-- 'print' (\"Last event was: \" '++' 'show' e)
3030-- @
31−--
31+--
3232-- Good sources of documentation for terminal programming are:
3333--
3434-- - <https://github.com/b4winckler/vim/blob/master/src/term.c>
@@ -50,7 +50,7 @@ module Graphics.Vty ( Vty(..)
5050 , module Graphics.Vty.Picture
5151 , DisplayRegion
5252 , Mode(..)
53− )
53+ )
5454 where
5555
5656import Graphics.Vty.Prelude
@@ -84,7 +84,7 @@ import Data.Monoid
8484-- when another update action is already then it's safe to call this on multiple threads.
8585--
8686-- \todo Remove explicit `shutdown` requirement.
87−data Vty = Vty
87+data Vty = Vty
8888 { -- | Outputs the given Picture. Equivalent to 'outputPicture' applied to a display context
8989 -- implicitly managed by Vty. The managed display context is reset on resize.
9090 update :: Picture -> IO ()
@@ -101,7 +101,7 @@ data Vty = Vty
101101 , refresh :: IO ()
102102 -- | Clean up after vty.
103103 -- The above methods will throw an exception if executed after this is executed.
104− , shutdown :: IO ()
104+ , shutdown :: IO ()
105105 }
106106
107107-- | Set up the state object for using vty. At most one state object should be
@@ -157,7 +157,7 @@ intMkVty input out = do
157157 maybe (return ()) innerUpdate mPic
158158
159159 let gkey = do k <- atomically $ readTChan $ _eventChannel input
160− case k of
160+ case k of
161161 (EvResize _ _) -> displayBounds out
162162 >>= return . (\(w,h)-> EvResize w h)
163163 _ -> return k
@@ -169,4 +169,3 @@ intMkVty input out = do
169169 , refresh = innerRefresh
170170 , shutdown = shutdownIo
171171 }
172−
src/Graphics/Vty/Attributes.hs+3−4
@@ -93,7 +93,7 @@ data Attr = Attr
9393
9494instance Monoid Attr where
9595 mempty = Attr mempty mempty mempty
96− mappend attr0 attr1 =
96+ mappend attr0 attr1 =
9797 Attr ( attrStyle attr0 `mappend` attrStyle attr1 )
9898 ( attrForeColor attr0 `mappend` attrForeColor attr1 )
9999 ( attrBackColor attr0 `mappend` attrBackColor attr1 )
@@ -141,7 +141,7 @@ magenta= ISOColor 5
141141cyan = ISOColor 6
142142white = ISOColor 7
143143
144−-- | Bright/Vivid variants of the standard 8-color ANSI
144+-- | Bright/Vivid variants of the standard 8-color ANSI
145145brightBlack, brightRed, brightGreen, brightYellow :: Color
146146brightBlue, brightMagenta, brightCyan, brightWhite :: Color
147147brightBlack = ISOColor 8
@@ -185,7 +185,7 @@ defaultStyleMask :: Style
185185defaultStyleMask = 0x00
186186
187187styleMask :: Attr -> Word8
188−styleMask attr
188+styleMask attr
189189 = case attrStyle attr of
190190 Default -> 0
191191 KeepCurrent -> 0
@@ -224,4 +224,3 @@ instance Default Attr where
224224-- set to brightMagenta.
225225currentAttr :: Attr
226226currentAttr = Attr KeepCurrent KeepCurrent KeepCurrent
227−
src/Graphics/Vty/Attributes/Color.hs+3−4
@@ -2,7 +2,7 @@ module Graphics.Vty.Attributes.Color where
22import Data.Word
33
44-- | Abstract data type representing a color.
5−--
5+--
66-- Currently the foreground and background color are specified as points in either a:
77--
88-- * 16 color palette. Where the first 8 colors are equal to the 8 colors of the ISO 6429 (ANSI) 8
@@ -10,7 +10,7 @@ import Data.Word
1010--
1111-- * 240 color palette. This palette is a regular sampling of the full RGB colorspace for the first
1212-- 224 colors. The remaining 16 colors is a greyscale palette.
13−--
13+--
1414-- The 8 ISO 6429 (ANSI) colors are as follows:
1515--
1616-- 0. black
@@ -36,7 +36,7 @@ import Data.Word
3636--
3737-- If the terminal reports <= 16 colors then the 240 color palette points are only mapped to the 8
3838-- color pallete. I'm not sure of the RGB points for the "bright" colors which is why they are not
39−-- addressable via the 240 color palette.
39+-- addressable via the 240 color palette.
4040--
4141-- If the terminal reports > 16 colors then the 240 color palette points are mapped to the nearest
4242-- points in a ("color count" - 16) subsampling of the 240 color palette.
@@ -48,4 +48,3 @@ import Data.Word
4848-- Seriously, terminal color support is INSANE.
4949data Color = ISOColor !Word8 | Color240 !Word8
5050 deriving ( Eq, Show, Read )
51−
src/Graphics/Vty/Attributes/Color240.hs+1−1
@@ -254,7 +254,7 @@ rgbColor r g b
254254 | r <= 255 && g <= 255 && b <= 175 = Color240 213
255255 | r <= 255 && g <= 255 && b <= 215 = Color240 214
256256 | r <= 255 && g <= 255 && b <= 255 = Color240 215
257− | otherwise = error (printf "RGB color %d %d %d does not map to 240 palette."
257+ | otherwise = error (printf "RGB color %d %d %d does not map to 240 palette."
258258 (fromIntegral r :: Int)
259259 (fromIntegral g :: Int)
260260 (fromIntegral b :: Int))
src/Graphics/Vty/Config.hs+2−2
@@ -14,7 +14,7 @@
1414-- earlier.
1515--
1616-- For all directives:
17−--
17+--
1818-- @
1919-- string := \"\\\"\" chars+ \"\\\"\"
2020-- @
@@ -40,7 +40,7 @@
4040--
4141-- @
4242-- \"map\" term string key modifier_list
43−-- where
43+-- where
4444-- key := KEsc | KChar Char | KBS ... (same as 'Key')
4545-- modifier_list := \"[\" modifier+ \"]\"
4646-- modifier := MShift | MCtrl | MMeta | MAlt
src/Graphics/Vty/Debug.hs+3−4
@@ -10,10 +10,10 @@ import Graphics.Vty.Attributes
1010import Graphics.Vty.Debug.Image
1111import Graphics.Vty.Span
1212
13−import qualified Data.Vector as Vector
13+import qualified Data.Vector as Vector
1414
1515rowOpsEffectedColumns :: DisplayOps -> [Int]
16−rowOpsEffectedColumns ops
16+rowOpsEffectedColumns ops
1717 = Vector.toList $ Vector.map spanOpsEffectedColumns ops
1818
1919allSpansHaveWidth :: DisplayOps -> Int -> Bool
@@ -23,7 +23,7 @@ allSpansHaveWidth ops expected
2323spanOpsEffectedRows :: DisplayOps -> Int
2424spanOpsEffectedRows ops
2525 = toEnum $ length (filter (not . null . Vector.toList) (Vector.toList ops))
26−
26+
2727type SpanConstructLog = [SpanConstructEvent]
2828data SpanConstructEvent = SpanSetAttr Attr
2929
@@ -37,4 +37,3 @@ data MockWindow = MockWindow Int Int
3737
3838regionForWindow :: MockWindow -> DisplayRegion
3939regionForWindow (MockWindow w h) = (w,h)
40−
src/Graphics/Vty/Debug/Image.hs+1−1
@@ -19,7 +19,7 @@ data ImageOp = ImageOp ImageEndo ImageEndo
1919type ImageEndo = Image -> Image
2020
2121debugImageOps :: [ImageOp]
22−debugImageOps =
22+debugImageOps =
2323 [ idImageOp
2424 -- , renderSingleColumnCharOp
2525 -- , renderDoubleColumnCharOp
src/Graphics/Vty/DisplayAttributes.hs+1−1
@@ -79,7 +79,7 @@ data DisplayColorDiff
7979
8080-- | Style attribute changes are transformed into a sequence of apply/removes of the individual
8181-- attributes.
82−data StyleStateChange
82+data StyleStateChange
8383 = ApplyStandout
8484 | RemoveStandout
8585 | ApplyUnderline
src/Graphics/Vty/Image.hs+10−11
@@ -61,7 +61,7 @@ infixr 4 <->
6161
6262-- | An area of the picture's bacground (See Background) of w columns and h rows.
6363backgroundFill :: Int -> Int -> Image
64−backgroundFill w h
64+backgroundFill w h
6565 | w == 0 = EmptyImage
6666 | h == 0 = EmptyImage
6767 | otherwise = BGFill w h
@@ -104,21 +104,21 @@ char a c =
104104 in HorizText a (TL.singleton c) displayWidth 1
105105
106106-- | A string of characters layed out on a single row with the same display attribute. The string is
107−-- assumed to be a sequence of ISO-10646 characters.
107+-- assumed to be a sequence of ISO-10646 characters.
108108--
109109-- Note: depending on how the Haskell compiler represents string literals a string literal in a
110−-- UTF-8 encoded source file, for example, may be represented as a ISO-10646 string.
110+-- UTF-8 encoded source file, for example, may be represented as a ISO-10646 string.
111111-- That is, I think, the case with GHC 6.10. This means, for the most part, you don't need to worry
112112-- about the encoding format when outputting string literals. Just provide the string literal
113113-- directly to iso10646String or string.
114−--
114+--
115115iso10646String :: Attr -> String -> Image
116116iso10646String a str =
117117 let displayWidth = safeWcswidth str
118118 in HorizText a (TL.pack str) displayWidth (length str)
119119
120120-- | Alias for iso10646String. Since the usual case is that a literal string like "foo" is
121−-- represented internally as a list of ISO 10646 31 bit characters.
121+-- represented internally as a list of ISO 10646 31 bit characters.
122122--
123123-- Note: Keep in mind that GHC will compile source encoded as UTF-8 but the literal strings, while
124124-- UTF-8 encoded in the source, will be transcoded to a ISO 10646 31 bit characters runtime
@@ -131,11 +131,11 @@ string = iso10646String
131131utf8String :: Attr -> [Word8] -> Image
132132utf8String a bytes = utf8Bytestring a (BL.pack bytes)
133133
134−-- | Renders a UTF-8 encoded lazy bytestring.
134+-- | Renders a UTF-8 encoded lazy bytestring.
135135utf8Bytestring :: Attr -> BL.ByteString -> Image
136136utf8Bytestring a bs = text a (TL.decodeUtf8 bs)
137137
138−-- | Renders a UTF-8 encoded strict bytestring.
138+-- | Renders a UTF-8 encoded strict bytestring.
139139utf8Bytestring' :: Attr -> B.ByteString -> Image
140140utf8Bytestring' a bs = text' a (T.decodeUtf8 bs)
141141
@@ -146,14 +146,14 @@ charFill _a _c 0 _h = EmptyImage
146146charFill _a _c _w 0 = EmptyImage
147147charFill a c w h =
148148 vertCat $ replicate (fromIntegral h) $ HorizText a txt displayWidth charWidth
149− where
149+ where
150150 txt = TL.replicate (fromIntegral w) (TL.singleton c)
151151 displayWidth = safeWcwidth c * (fromIntegral w)
152152 charWidth = fromIntegral w
153153
154154-- | The empty image. Useful for fold combinators. These occupy no space nor define any display
155155-- attributes.
156−emptyImage :: Image
156+emptyImage :: Image
157157emptyImage = EmptyImage
158158
159159-- | pad the given image. This adds background character fills to the left, top, right, bottom.
@@ -163,7 +163,7 @@ pad 0 0 0 0 i = i
163163pad inL inT inR inB inImage
164164 | inL < 0 || inT < 0 || inR < 0 || inB < 0 = error "cannot pad by negative amount"
165165 | otherwise = go inL inT inR inB inImage
166− where
166+ where
167167 -- TODO: uh.
168168 go 0 0 0 0 i = i
169169 go 0 0 0 b i = VertJoin i (BGFill w b) w h
@@ -299,4 +299,3 @@ resizeHeight h i = case h `compare` imageHeight i of
299299 LT -> cropBottom h i
300300 EQ -> i
301301 GT -> i <-> BGFill (imageWidth i) (h - imageHeight i)
302−
src/Graphics/Vty/Image/Internal.hs+6−7
@@ -65,7 +65,7 @@ clipText txt leftSkip rightClip =
6565-- * a cropped image
6666--
6767-- * an empty image of no size or content.
68−data Image =
68+data Image =
6969 -- | A horizontal text span has a row height of 1.
7070 HorizText
7171 { attr :: Attr
@@ -80,7 +80,7 @@ data Image =
8080 -- required to be between two images of equal height. The horizJoin constructor adds background
8181 -- fills to the provided images that assure this is true for the HorizJoin value produced.
8282 | HorizJoin
83− { partLeft :: Image
83+ { partLeft :: Image
8484 , partRight :: Image
8585 , outputWidth :: Int -- ^ imageWidth partLeft == imageWidth partRight. Always > 0
8686 , outputHeight :: Int -- ^ imageHeight partLeft == imageHeight partRight. Always > 0
@@ -136,10 +136,10 @@ data Image =
136136 }
137137 -- | The empty image
138138 --
139− -- The combining operators identity constant.
139+ -- The combining operators identity constant.
140140 -- EmptyImage <|> a = a
141141 -- EmptyImage <-> a = a
142− --
142+ --
143143 -- Any image of zero size equals the empty image.
144144 | EmptyImage
145145 deriving (Eq, Generic)
@@ -198,7 +198,7 @@ ppImageStructure inImg = go 0 inImg
198198 = "CropTop("++ show outputWidth ++ "," ++ show topSkip ++ "->" ++ show outputHeight ++ ")\n"
199199 ++ go (i+1) croppedImage
200200 pp _ EmptyImage = "EmptyImage"
201−
201+
202202instance NFData Image where
203203 rnf EmptyImage = ()
204204 rnf (CropRight i w h) = i `deepseq` w `seq` h `seq` ()
@@ -234,7 +234,7 @@ imageHeight CropBottom { outputHeight = h } = h
234234imageHeight CropTop { outputHeight = h } = h
235235imageHeight EmptyImage = 0
236236
237−-- | Append in the Monoid instance is equivalent to <->.
237+-- | Append in the Monoid instance is equivalent to <->.
238238instance Monoid Image where
239239 mempty = EmptyImage
240240 mappend = vertJoin
@@ -302,4 +302,3 @@ vertJoin i0 i1
302302 h1 = imageHeight i1
303303 h = h0 + h1
304304vertJoin _ _ = error "vertJoin applied to undefined values."
305−
src/Graphics/Vty/Inline.hs+5−5
@@ -1,5 +1,5 @@
11-- | The inline module provides a limited interface to changing the style of terminal output. The
2−-- intention is for this interface to be used inline with other output systems.
2+-- intention is for this interface to be used inline with other output systems.
33--
44-- The changes specified by the InlineM monad are applied to the terminals display attributes. These
55-- display attributes effect the display of all following text output to the terminal file
@@ -11,7 +11,7 @@
1111-- @
1212-- putStr \"Not styled. \"
1313-- putAttrChange_ $ do
14−-- backColor red
14+-- backColor red
1515-- applyStyle underline
1616-- putStr \" Styled! \"
1717-- putAttrChange_ $ defaultAll
@@ -74,14 +74,14 @@ applyStyle s = modify $ flip mappend ( currentAttr `withStyle` s )
7474
7575-- | Attempt to remove the specified 'Style' from the display of the following text.
7676--
77−-- This will fail if applyStyle for the given style has not been previously called.
77+-- This will fail if applyStyle for the given style has not been previously called.
7878removeStyle :: Style -> InlineM ()
79−removeStyle sMask = modify $ \attr ->
79+removeStyle sMask = modify $ \attr ->
8080 let style' = case attrStyle attr of
8181 Default -> error $ "Graphics.Vty.Inline: Cannot removeStyle if applyStyle never used."
8282 KeepCurrent -> error $ "Graphics.Vty.Inline: Cannot removeStyle if applyStyle never used."
8383 SetTo s -> s .&. complement sMask
84− in attr { attrStyle = SetTo style' }
84+ in attr { attrStyle = SetTo style' }
8585
8686-- | Reset the display attributes
8787defaultAll :: InlineM ()
src/Graphics/Vty/Input.hs+2−2
@@ -113,7 +113,7 @@
113113-- Some terminfo capabilities specify millisecond delays. (Capabilities are how terminfo describes
114114-- the control sequence to output red, for instance) This is to account for the slow speed of
115115-- hardcopy teletype interfaces. Cause, uh, we totally still use those.
116−--
116+--
117117-- The output encoding of colors and attributes are also rife with issues.
118118--
119119-- == See also
@@ -162,7 +162,7 @@ import Data.Monoid ((<>))
162162-- suspended if the output terminal cannot keep up. I presume this has little effect these
163163-- days. I hope this means that output will be buffered if the terminal cannot keep up. In the
164164-- old days the output might of been dropped?
165−--
165+--
166166-- "raw" mode is used for input.
167167--
168168-- * ISIG disabled
src/Graphics/Vty/Input/Classify.hs+1−1
@@ -44,7 +44,7 @@ compile table = cl' where
4444 -- produced.
4545 -- The test verifyFullSynInputToEvent2x verifies this.
4646 -- H: There will always be one match. The prefixSet contains, by definition, all
47− -- prefixes of an event.
47+ -- prefixes of an event.
4848 False ->
4949 let inputPrefixes = reverse $ take maxValidInputLength $ tail $ inits inputBlock
5050 in case mapMaybe (\s -> (,) s `fmap` M.lookup s eventForInput) inputPrefixes of
src/Graphics/Vty/Input/Loop.hs+1−1
@@ -147,7 +147,7 @@ parseEvent = do
147147 logMsg $ "remaining: " ++ show remaining
148148 unprocessedBytes .= remaining
149149 return e
150− _ -> mzero
150+ _ -> mzero
151151
152152dropInvalid :: InputM ()
153153dropInvalid = do
src/Graphics/Vty/Input/Terminfo.hs+2−2
@@ -113,7 +113,7 @@ specialSupportKeys =
113113-- * kcbt - back tab
114114--
115115-- * kc1 - keypad left-down
116−--
116+--
117117-- * kc3 - keypad right-down
118118--
119119-- * kdch1 - delete
@@ -121,7 +121,7 @@ specialSupportKeys =
121121-- * kcud1 - down
122122--
123123-- * kend - end
124−--
124+--
125125-- * kent - enter
126126--
127127-- * kf0 - kf63 - function keys
src/Graphics/Vty/Input/Terminfo/ANSIVT.hs+3−4
@@ -1,5 +1,5 @@
11-- | Input mappings for ANSI/VT100/VT50 terminals that is missing from terminfo.
2−--
2+--
33-- Or that are sent regardless of terminfo by terminal emulators. EG: Terminal emulators will often
44-- use VT50 input bytes regardless of declared terminal type. This provides compatibility with
55-- programs that don't follow terminfo.
@@ -49,8 +49,8 @@ navKeys3 =
4949 [KIns,KDel,KPageUp,KPageDown,KHome,KEnd]
5050
5151-- | encoding for shift plus function keys
52−--
53−-- According to
52+--
53+-- According to
5454--
5555-- * http://aperiodic.net/phil/archives/Geekery/term-function-keys.html
5656--
@@ -84,4 +84,3 @@ classifyTable =
8484 , functionKeys1
8585 , functionKeys2
8686 ]
87−
src/Graphics/Vty/Output/Interface.hs+18−18
@@ -43,12 +43,12 @@ data Mode = Mouse
4343 deriving (Eq, Read, Show)
4444
4545data Output = Output
46− { -- | Text identifier for the output device. Used for debugging.
46+ { -- | Text identifier for the output device. Used for debugging.
4747 terminalID :: String
4848 , releaseTerminal :: forall m. MonadIO m => m ()
49− -- | Clear the display and initialize the terminal to some initial display state.
49+ -- | Clear the display and initialize the terminal to some initial display state.
5050 --
51− -- The expectation of a program is that the display starts in some initial state.
51+ -- The expectation of a program is that the display starts in some initial state.
5252 -- The initial state would consist of fixed values:
5353 --
5454 -- - cursor at top left
@@ -80,7 +80,7 @@ data Output = Output
8080 , getModeStatus :: forall m. MonadIO m => Mode -> m Bool
8181 , assumedStateRef :: IORef AssumedState
8282 -- | Acquire display access to the given region of the display.
83− -- Currently all regions have the upper left corner of (0,0) and the lower right corner at
83+ -- Currently all regions have the upper left corner of (0,0) and the lower right corner at
8484 -- (max displayWidth providedWidth, max displayHeight providedHeight)
8585 , mkDisplayContext :: forall m. MonadIO m => Output -> DisplayRegion -> m DisplayContext
8686 -- | Ring the terminal bell if supported.
@@ -102,7 +102,7 @@ initialAssumedState = AssumedState Nothing Nothing
102102
103103data DisplayContext = DisplayContext
104104 { contextDevice :: Output
105− -- | Provide the bounds of the display context.
105+ -- | Provide the bounds of the display context.
106106 , contextRegion :: DisplayRegion
107107 -- | sets the output position to the specified row and column. Where the number of bytes
108108 -- required for the control codes can be specified seperate from the actual byte sequence.
@@ -134,16 +134,16 @@ writeUtf8Text = writeByteString
134134
135135-- | Displays the given `Picture`.
136136--
137−-- 0. The image is cropped to the display size.
137+-- 0. The image is cropped to the display size.
138138--
139139-- 1. Converted into a sequence of attribute changes and text spans.
140−--
140+--
141141-- 2. The cursor is hidden.
142142--
143143-- 3. Serialized to the display.
144144--
145145-- 4. The cursor is then shown and positioned or kept hidden.
146−--
146+--
147147-- todo: specify possible IO exceptions.
148148-- abstract from IO monad to a MonadIO instance.
149149outputPicture :: MonadIO m => DisplayContext -> Picture -> m ()
@@ -193,7 +193,7 @@ writeOutputOps dc initialAttr diffs ops =
193193 (0, mempty, diffs)
194194 ops
195195 in out
196− where
196+ where
197197 writeOutputOps' (y, out, True : diffs') spanOps
198198 = let spanOut = writeSpanOps dc y initialAttr spanOps
199199 out' = out `mappend` spanOut
@@ -229,7 +229,7 @@ writeSpanOp dc (RowEnd _) fattr = (writeDefaultAttr dc `mappend` writeRowEnd dc,
229229-- needs to be translated to column, row positions.
230230data CursorOutputMap = CursorOutputMap
231231 { charToOutputPos :: (Int, Int) -> (Int, Int)
232− }
232+ }
233233
234234cursorOutputMap :: DisplayOps -> Cursor -> CursorOutputMap
235235cursorOutputMap spanOps _cursor = CursorOutputMap
@@ -239,18 +239,18 @@ cursorOutputMap spanOps _cursor = CursorOutputMap
239239cursorColumnOffset :: DisplayOps -> Int -> Int -> Int
240240cursorColumnOffset ops cx cy =
241241 let cursorRowOps = Vector.unsafeIndex ops (fromEnum cy)
242− (outOffset, _, _)
243− = Vector.foldl' ( \(d, currentCx, done) op ->
242+ (outOffset, _, _)
243+ = Vector.foldl' ( \(d, currentCx, done) op ->
244244 if done then (d, currentCx, done) else case spanOpHasWidth op of
245245 Nothing -> (d, currentCx, False)
246246 Just (cw, ow) -> case compare cx (currentCx + cw) of
247247 GT -> ( d + ow
248248 , currentCx + cw
249− , False
249+ , False
250250 )
251251 EQ -> ( d + ow
252252 , currentCx + cw
253− , True
253+ , True
254254 )
255255 LT -> ( d + columnsToCharOffset (cx - currentCx) op
256256 , currentCx + cw
@@ -264,7 +264,7 @@ cursorColumnOffset ops cx cy =
264264-- | Not all terminals support all display attributes. This filters a display attribute to what the
265265-- given terminal can display.
266266limitAttrForDisplay :: Output -> Attr -> Attr
267−limitAttrForDisplay t attr
267+limitAttrForDisplay t attr
268268 = attr { attrForeColor = clampColor $ attrForeColor attr
269269 , attrBackColor = clampColor $ attrBackColor attr
270270 }
@@ -272,7 +272,7 @@ limitAttrForDisplay t attr
272272 clampColor Default = Default
273273 clampColor KeepCurrent = KeepCurrent
274274 clampColor (SetTo c) = clampColor' c
275− clampColor' (ISOColor v)
275+ clampColor' (ISOColor v)
276276 | contextColorCount t < 8 = Default
277277 | contextColorCount t < 16 && v >= 8 = SetTo $ ISOColor (v - 8)
278278 | otherwise = SetTo $ ISOColor v
@@ -281,7 +281,7 @@ limitAttrForDisplay t attr
281281 | contextColorCount t < 8 = Default
282282 | contextColorCount t < 16 = Default
283283 | contextColorCount t <= 256 = SetTo $ Color240 v
284− | otherwise
285− = let p :: Double = fromIntegral v / 240.0
284+ | otherwise
285+ = let p :: Double = fromIntegral v / 240.0
286286 v' = floor $ p * (fromIntegral $ contextColorCount t)
287287 in SetTo $ Color240 v'
src/Graphics/Vty/Output/TerminfoBased.hs+25−26
@@ -50,7 +50,7 @@ import Data.Foldable (foldMap)
5050import Data.Monoid
5151#endif
5252
53−data TerminfoCaps = TerminfoCaps
53+data TerminfoCaps = TerminfoCaps
5454 { smcup :: Maybe CapExpression
5555 , rmcup :: Maybe CapExpression
5656 , cup :: CapExpression
@@ -77,7 +77,7 @@ data DisplayAttrCaps = DisplayAttrCaps
7777 , enterDimMode :: Maybe CapExpression
7878 , enterBoldMode :: Maybe CapExpression
7979 }
80−
80+
8181-- kinda like: https://code.google.com/p/vim/source/browse/src/fileio.c#10422
8282-- fdWriteBuf will throw on error. Unless the error is EINTR. On EINTR the write will be retried.
8383fdWriteAll :: Fd -> Ptr Word8 -> Int -> Int -> IO Int
@@ -99,10 +99,10 @@ sendCapToTerminal t cap capParams = do
9999 - terminfo does not support some features that would increase efficiency and improve compatibility:
100100 -
101101 - * determine the character encoding supported by the terminal. Should this be taken from the LANG
102− - environment variable?
102+ - environment variable?
103103 -
104104 - * Provide independent string capabilities for all display attributes.
105− -
105+ -
106106 - todo: Some display attributes like underline and bold have independent string capabilities that
107107 - should be used instead of the generic "sgr" string capability.
108108 -}
@@ -113,7 +113,7 @@ reserveTerminal termName outFd = liftIO $ do
113113 -- if set foreground is not set then all color changing style attributes are filtered.
114114 msetaf <- probeCap ti "setaf"
115115 msetf <- probeCap ti "setf"
116− let (noColors, useAlt, setForeCap)
116+ let (noColors, useAlt, setForeCap)
117117 = case msetaf of
118118 Just setaf -> (False, False, setaf)
119119 Nothing -> case msetf of
@@ -121,7 +121,7 @@ reserveTerminal termName outFd = liftIO $ do
121121 Nothing -> (True, True, error $ "no fore color support for terminal " ++ termName)
122122 msetab <- probeCap ti "setab"
123123 msetb <- probeCap ti "setb"
124− let set_back_cap
124+ let set_back_cap
125125 = case msetab of
126126 Nothing -> case msetb of
127127 Just setb -> setb
@@ -190,13 +190,13 @@ reserveTerminal termName outFd = liftIO $ do
190190 return t
191191
192192requireCap :: (Applicative m, MonadIO m) => Terminfo.Terminal -> String -> m CapExpression
193−requireCap ti capName
193+requireCap ti capName
194194 = case Terminfo.getCapability ti (Terminfo.tiGetStr capName) of
195195 Nothing -> fail $ "Terminal does not define required capability \"" ++ capName ++ "\""
196196 Just capStr -> parseCap capStr
197197
198198probeCap :: (Applicative m, MonadIO m) => Terminfo.Terminal -> String -> m (Maybe CapExpression)
199−probeCap ti capName
199+probeCap ti capName
200200 = case Terminfo.getCapability ti (Terminfo.tiGetStr capName) of
201201 Nothing -> return Nothing
202202 Just capStr -> Just <$> parseCap capStr
@@ -207,11 +207,11 @@ parseCap capStr = do
207207 Left e -> fail $ show e
208208 Right cap -> return cap
209209
210−currentDisplayAttrCaps :: ( Applicative m, MonadIO m )
211− => Terminfo.Terminal
210+currentDisplayAttrCaps :: ( Applicative m, MonadIO m )
211+ => Terminfo.Terminal
212212 -> m DisplayAttrCaps
213−currentDisplayAttrCaps ti
214− = pure DisplayAttrCaps
213+currentDisplayAttrCaps ti
214+ = pure DisplayAttrCaps
215215 <*> probeCap ti "sgr"
216216 <*> probeCap ti "smso"
217217 <*> probeCap ti "rmso"
@@ -224,7 +224,7 @@ currentDisplayAttrCaps ti
224224foreign import ccall "gwinsz.h vty_c_get_window_size" c_getWindowSize :: Fd -> IO CLong
225225
226226getWindowSize :: Fd -> IO (Int,Int)
227−getWindowSize fd = do
227+getWindowSize fd = do
228228 (a,b) <- (`divMod` 65536) `fmap` c_getWindowSize fd
229229 return (fromIntegral b, fromIntegral a)
230230
@@ -249,14 +249,14 @@ terminfoDisplayContext tActual terminfoCaps r = return dc
249249-- | Portably setting the display attributes is a giant pain in the ass.
250250--
251251-- If the terminal supports the sgr capability (which sets the on/off state of each style
252−-- directly ; and, for no good reason, resets the colors to the default) this procedure is used:
252+-- directly ; and, for no good reason, resets the colors to the default) this procedure is used:
253253--
254254-- 0. set the style attributes. This resets the fore and back color.
255255--
256256-- 1, If a foreground color is to be set then set the foreground color
257257--
258258-- 2. likewise with the background color
259−--
259+--
260260-- If the terminal does not support the sgr cap then:
261261-- if there is a change from an applied color to the default (in either the fore or back color)
262262-- then:
@@ -290,13 +290,13 @@ terminfoWriteSetAttr dc terminfoCaps prevAttr reqAttr diffs = do
290290 (styleToApplySeq $ fixedStyle attr) of
291291 -- only way to reset a color to the defaults
292292 EnterExitSeq caps -> writeDefaultAttr dc
293− `mappend`
293+ `mappend`
294294 foldMap (\cap -> writeCapExpr cap []) caps
295295 `mappend`
296296 setColors
297297 -- implicitly resets the colors to the defaults
298− SetState state -> writeCapExpr (fromJust $ setAttrStates
299− $ displayAttrCaps
298+ SetState state -> writeCapExpr (fromJust $ setAttrStates
299+ $ displayAttrCaps
300300 $ terminfoCaps
301301 )
302302 (sgrArgsForState state)
@@ -320,12 +320,12 @@ terminfoWriteSetAttr dc terminfoCaps prevAttr reqAttr diffs = do
320320 `mappend`
321321 writeColorDiff setBackColor (backColorDiff diffs)
322322 -- implicitly resets the colors to the defaults
323− SetState state -> writeCapExpr (fromJust $ setAttrStates
323+ SetState state -> writeCapExpr (fromJust $ setAttrStates
324324 $ displayAttrCaps terminfoCaps
325325 )
326326 (sgrArgsForState state)
327327 `mappend` setColors
328− where
328+ where
329329 colorMap = case useAltColorMap terminfoCaps of
330330 False -> ansiColorIndex
331331 True -> altColorIndex
@@ -357,7 +357,7 @@ ansiColorIndex (ISOColor v) = fromEnum v
357357ansiColorIndex (Color240 v) = 16 + fromEnum v
358358
359359-- | For terminals without setaf/setab
360−--
360+--
361361-- See table in `man terminfo`
362362-- Will error if not in table.
363363altColorIndex :: Color -> Int
@@ -375,7 +375,7 @@ altColorIndex (Color240 v) = 16 + fromEnum v
375375{- | The sequence of terminfo caps to apply a given style are determined according to these rules.
376376 -
377377 - 1. The assumption is that it's preferable to use the simpler enter/exit mode capabilities than
378− - the full set display attribute state capability.
378+ - the full set display attribute state capability.
379379 -
380380 - 2. If a mode is supposed to be removed but there is not an exit capability defined then the
381381 - display attributes are reset to defaults then the display attribute state is set.
@@ -422,7 +422,7 @@ reqDisplayCapSeqFor caps s diffs
422422 ( False, _ ) -> EnterExitSeq $ map enterExitCap diffs
423423 -- If not all the diffs have an enter-exit cap and there is no set state cap then filter out
424424 -- all unsupported diffs and just apply the rest
425− ( True, False ) -> EnterExitSeq $ map enterExitCap
425+ ( True, False ) -> EnterExitSeq $ map enterExitCap
426426 $ filter (not . noEnterExitCap) diffs
427427 -- if not all the diffs have an enter-exit can and there is a set state cap then just use
428428 -- the set state cap.
@@ -469,9 +469,8 @@ styleToApplySeq s = concat
469469 , applyIfRequired ApplyDim dim
470470 , applyIfRequired ApplyBlink bold
471471 ]
472− where
473− applyIfRequired op flag
472+ where
473+ applyIfRequired op flag
474474 = if 0 == (flag .&. s)
475475 then []
476476 else [op]
477−
src/Graphics/Vty/Output/XTermColor.hs+1−2
@@ -32,7 +32,7 @@ import Data.List (isInfixOf)
3232import Data.Maybe (catMaybes)
3333import Data.Monoid ((<>))
3434
35−-- | Initialize the display to UTF-8.
35+-- | Initialize the display to UTF-8.
3636reserveTerminal :: ( Applicative m, MonadIO m ) => String -> Fd -> m Output
3737reserveTerminal variant outFd = liftIO $ do
3838 let flushedPut = void . fdWrite outFd
@@ -112,4 +112,3 @@ xtermInlineHack :: Output -> IO ()
112112xtermInlineHack t = do
113113 let writeReset = foldMap (writeWord8.toEnum.fromEnum) "\ESC[K"
114114 outputByteBuffer t $ writeToByteString writeReset
115−
src/Graphics/Vty/Picture.hs+5−5
@@ -11,7 +11,7 @@ import Graphics.Vty.Image
1111
1212import Control.DeepSeq
1313
14−-- | The type of images to be displayed using 'update'.
14+-- | The type of images to be displayed using 'update'.
1515--
1616-- Can be constructed directly or using `picForImage`. Which provides an initial instance with
1717-- reasonable defaults for picCursor and picBackground.
@@ -42,7 +42,7 @@ addToBottom p i = p {picLayers = picLayers p ++ [i]}
4242-- | Create a picture for display for the given image. The picture will not have a displayed cursor
4343-- and no background pattern (ClearBackground) will be used.
4444picForImage :: Image -> Picture
45−picForImage i = Picture
45+picForImage i = Picture
4646 { picCursor = NoCursor
4747 , picLayers = [i]
4848 , picBackground = ClearBackground
@@ -52,17 +52,17 @@ picForImage i = Picture
5252--
5353-- The picture will not have a displayed cursor and no background apttern (ClearBackgroun) will be
5454-- used.
55−--
55+--
5656-- The first 'Image' is the top layer.
5757picForLayers :: [Image] -> Picture
58−picForLayers is = Picture
58+picForLayers is = Picture
5959 { picCursor = NoCursor
6060 , picLayers = is
6161 , picBackground = ClearBackground
6262 }
6363
6464-- | A picture can be configured either to not show the cursor or show the cursor at the specified
65−-- character position.
65+-- character position.
6666--
6767-- There is not a 1 to 1 map from character positions to a row and column on the screen due to
6868-- characters that take more than 1 column.
src/Graphics/Vty/PictureToSpans.hs+4−4
@@ -200,7 +200,7 @@ buildSpans image outRegion = do
200200 outOps <- MVector.replicate (regionHeight outRegion) Vector.empty
201201 -- \todo I think building the span operations in display order would provide better performance.
202202 -- However, I got stuck trying to implement an algorithm that did this. This will be considered
203− -- as a possible future optimization.
203+ -- as a possible future optimization.
204204 --
205205 -- A depth first traversal of the image is performed. ordered according to the column range
206206 -- defined by the image from least to greatest. The output row ops will at least have the
@@ -208,7 +208,7 @@ buildSpans image outRegion = do
208208 -- all unspecified columns.
209209 --
210210 -- The images are made into span operations from left to right. It's possible that this could
211− -- easily be made to assure top to bottom output as well.
211+ -- easily be made to assure top to bottom output as well.
212212 when (regionHeight outRegion > 0 && regionWidth outRegion > 0) $ do
213213 -- The ops builder recursively descends the image and outputs span ops that would
214214 -- display that image. The number of columns remaining in this row before exceeding the
@@ -297,7 +297,7 @@ addMaybeClipped CropTop {croppedImage, topSkip} = do
297297 skipRows += topSkip
298298 addMaybeClipped croppedImage
299299
300−addMaybeClippedJoin :: forall s . String
300+addMaybeClippedJoin :: forall s . String
301301 -> Lens BlitState BlitState Int Int
302302 -> Lens BlitState BlitState Int Int
303303 -> Lens BlitState BlitState Int Int
@@ -312,7 +312,7 @@ addMaybeClippedJoin name skip remaining offset i0Dim i0 i1 size = do
312312 case state^.skip of
313313 s -- TODO: check if clipped in other dim. if not use addUnclipped
314314 | s > size -> put $ state & skip -~ size
315− | s == 0 -> if state^.remaining > i0Dim
315+ | s == 0 -> if state^.remaining > i0Dim
316316 then do
317317 addMaybeClipped i0
318318 put $ state & offset +~ i0Dim & remaining -~ i0Dim
src/Graphics/Vty/Span.hs+3−5
@@ -31,7 +31,7 @@ data SpanOp =
3131 -- | a span of UTF-8 text occupies a specific number of screen space columns. A single UTF
3232 -- character does not necessarially represent 1 colunm. See Codec.Binary.UTF8.Width
3333 -- TextSpan [Attr] [output width in columns] [number of characters] [data]
34− TextSpan
34+ TextSpan
3535 { textSpanAttr :: !Attr
3636 , textSpanOutputWidth :: !Int
3737 , textSpanCharWidth :: !Int
@@ -89,7 +89,6 @@ splitOpsAt inW inOps = splitOpsAt' inW inOps
8989 , Vector.cons (Skip (w - remainingColumns)) (Vector.tail ops)
9090 )
9191 RowEnd _ -> error "cannot split ops containing a row end"
92−
9392
9493-- | vector of span operation vectors for display. One per row of the output region.
9594type DisplayOps = Vector SpanOps
@@ -103,7 +102,7 @@ instance Show SpanOp where
103102--
104103-- All spans are verified to define same number of columns. See: VerifySpanOps
105104displayOpsColumns :: DisplayOps -> Int
106−displayOpsColumns ops
105+displayOpsColumns ops
107106 | Vector.length ops == 0 = 0
108107 | otherwise = Vector.length $ Vector.head ops
109108
@@ -117,7 +116,7 @@ effectedRegion ops = (displayOpsColumns ops, displayOpsRows ops)
117116-- | The number of columns a SpanOps effects.
118117spanOpsEffectedColumns :: SpanOps -> Int
119118spanOpsEffectedColumns inOps = Vector.foldl' spanOpsEffectedColumns' 0 inOps
120− where
119+ where
121120 spanOpsEffectedColumns' t (TextSpan _ w _ _ ) = t + w
122121 spanOpsEffectedColumns' t (Skip w) = t + w
123122 spanOpsEffectedColumns' t (RowEnd w) = t + w
@@ -135,4 +134,3 @@ columnsToCharOffset cx (TextSpan _ _ _ utf8Str) =
135134 in wcswidth (take cx str)
136135columnsToCharOffset cx (Skip _) = cx
137136columnsToCharOffset cx (RowEnd _) = cx
138−
test/BenchNoDiffOpt.hs+2−2
@@ -16,7 +16,7 @@ import System.Environment( getArgs )
1616import System.IO
1717import System.Random
1818
19−bench0 = do
19+bench0 = do
2020 let fixedGen = mkStdGen 0
2121 setStdGen fixedGen
2222 vty <- mkVty def
@@ -29,7 +29,7 @@ bench0 = do
2929 shutdown vty
3030 return $ Bench images bench
3131
32−flipOut vty n image0 image1 =
32+flipOut vty n image0 image1 =
3333 let !pLeft = picForImage image0
3434 !pRight = picForImage image1
3535 wLeft 0 = return ()
test/BenchRenderChar.hs+1−1
@@ -23,7 +23,7 @@ bench0 = do
2323 shutdown vty
2424 return $ Bench testChars bench
2525
26−testImageUsingChar c w h
26+testImageUsingChar c w h
2727 = vertCat $ replicate (fromIntegral h)
2828 $ horizCat $ map (char defAttr) (replicate (fromIntegral w) c)
2929
test/BenchVerticalScroll.hs+3−4
@@ -14,7 +14,7 @@ import System.Environment( getArgs )
1414import System.IO
1515import System.Random
1616
17−bench0 = do
17+bench0 = do
1818 let fixedGen = mkStdGen 0
1919 setStdGen fixedGen
2020 return $ Bench (return ()) (\() -> mkVty def >>= liftM2 (>>) run shutdown)
@@ -49,13 +49,12 @@ pad :: Int -> Image -> Image
4949pad ml img = img <|> charFill defAttr ' ' (ml - imageWidth img) 1
5050
5151clines :: StdGen -> Int -> [Image]
52−clines g maxll = map (pad maxll . horizCat . map (uncurry string))
52+clines g maxll = map (pad maxll . horizCat . map (uncurry string))
5353 $ fold (length . snd) (lengths maxll g1) (nums g2)
5454 where (g1,g2) = split g
5555
5656benchgen :: DisplayRegion -> [Picture]
57−benchgen (w,h)
57+benchgen (w,h)
5858 = take 2000 $ map ((\i -> picForImage i) . vertCat . take (fromEnum h))
5959 $ tails
6060 $ clines (mkStdGen 80) w
61−
test/ControlTable.hs+1−1
@@ -5,7 +5,7 @@ import Graphics.Vty.ControlStrings
55import System.Console.Terminfo
66
77main = do
8− terminal <- setupTermFromEnv
8+ terminal <- setupTermFromEnv
99 controlTable <- init_controlTable terminal
1010 putStrLn $ "ANSI terminal show cursor string: " ++ show cvis
1111 putStrLn $ "Current terminal show cursor string: " ++ show (showCursorStr controlTable)
test/Issue18.hs+3−4
@@ -13,8 +13,8 @@ main = do
1313 play vty sx sy
1414
1515play :: Vty -> Int -> Int -> IO ()
16−play vty sx sy =
17− let
16+play vty sx sy =
17+ let
1818 testScreen = pic {
1919 pCursor = NoCursor
2020 , pImage = box 10 10 }
@@ -31,6 +31,5 @@ box w h =
3131 vertLine = renderFill attr '|' 1 (h - 2)
3232 horizLine = corner <|> renderHFill attr '-' (w - 2) <|> corner
3333 centerArea = vertLine <|> renderFill attr 'X' (w - 2) (h - 2) <|> vertLine
34− in
34+ in
3535 horizLine <-> centerArea <-> horizLine
36−
test/Makefile+2−2
@@ -45,7 +45,7 @@ all : $(VERIF_TESTS)
4545
4646.PHONY: $(TESTS)
4747.SECONDEXPANSION:
48−$(TESTS) :
48+$(TESTS) :
4949 @echo running test $@
5050 @mkdir -p results/$@
5151 ( ghc $(GHC_PROF_ARGS) $@ \
@@ -54,7 +54,7 @@ $(TESTS) :
5454 )
5555
5656.PHONY: interactive_terminal_test
57−interactive_terminal_test :
57+interactive_terminal_test :
5858 ghc $(GHC_ARGS) $@ && ./$@
5959
6060.PHONY: core
test/Verify.hs+3−4
@@ -35,7 +35,7 @@ import qualified Test.QuickCheck as QC
3535import Test.QuickCheck.Modifiers
3636import Test.QuickCheck.Property hiding ( Result(..) )
3737import qualified Test.QuickCheck.Property as Prop
38−import Test.QuickCheck.Monadic ( monadicIO )
38+import Test.QuickCheck.Monadic ( monadicIO )
3939
4040import Text.Printf
4141
@@ -56,7 +56,7 @@ verify testName p = Test $ TestInstance
5656 case qcResult of
5757 QC.Success {..} -> return $ Finished TS.Pass
5858 QC.Failure {numShrinks,reason} -> return $ Finished
59− $ TS.Fail $ "After "
59+ $ TS.Fail $ "After "
6060 ++ show numShrinks ++ " shrinks determined failure to be: "
6161 ++ show reason
6262 _ -> return $ Finished $ TS.Fail "TODO(corey): add failure message"
@@ -87,7 +87,7 @@ liftIOResult = ioProperty
8787
8888#if __GLASGOW_HASKELL__ <= 701
8989instance Random Word where
90− random g =
90+ random g =
9191 let (i :: Int, g') = random g
9292 in (toEnum i, g')
9393 randomR (l,h) g =
@@ -97,4 +97,3 @@ instance Random Word where
9797
9898data Bench where
9999 Bench :: forall v . NFData v => IO v -> (v -> IO ()) -> Bench
100−
test/Verify/Data/Terminfo/Parse.hs+12−13
@@ -19,22 +19,22 @@ data NonParamCapString = NonParamCapString String
1919 deriving Show
2020
2121instance Arbitrary NonParamCapString where
22− arbitrary
22+ arbitrary
2323 = ( do
2424 s <- listOf1 $ (choose (0, 255) >>= return . toEnum) `suchThat` (/= '%')
2525 return $ NonParamCapString s
26− ) `suchThat` ( \(NonParamCapString str) -> length str < 255 )
26+ ) `suchThat` ( \(NonParamCapString str) -> length str < 255 )
2727
2828data LiteralPercentCap = LiteralPercentCap String [Word8]
2929 deriving ( Show )
3030
3131instance Arbitrary LiteralPercentCap where
32− arbitrary
32+ arbitrary
3333 = ( do
3434 NonParamCapString s <- arbitrary
3535 (s', bytes) <- insertEscapeOp "%" [toEnum $ fromEnum '%'] s
3636 return $ LiteralPercentCap s' bytes
37− ) `suchThat` ( \(LiteralPercentCap str _) -> length str < 255 )
37+ ) `suchThat` ( \(LiteralPercentCap str _) -> length str < 255 )
3838
3939data IncFirstTwoCap = IncFirstTwoCap String [Word8]
4040 deriving ( Show )
@@ -45,7 +45,7 @@ instance Arbitrary IncFirstTwoCap where
4545 NonParamCapString s <- arbitrary
4646 (s', bytes) <- insertEscapeOp "i" [] s
4747 return $ IncFirstTwoCap s' bytes
48− ) `suchThat` ( \(IncFirstTwoCap str _) -> length str < 255 )
48+ ) `suchThat` ( \(IncFirstTwoCap str _) -> length str < 255 )
4949
5050data PushParamCap = PushParamCap String Int [Word8]
5151 deriving ( Show )
@@ -57,7 +57,7 @@ instance Arbitrary PushParamCap where
5757 n <- choose (1,9)
5858 (s', bytes) <- insertEscapeOp ("p" ++ show n) [] s
5959 return $ PushParamCap s' n bytes
60− ) `suchThat` ( \(PushParamCap str _ _) -> length str < 255 )
60+ ) `suchThat` ( \(PushParamCap str _ _) -> length str < 255 )
6161
6262data DecPrintCap = DecPrintCap String Int [Word8]
6363 deriving ( Show )
@@ -69,7 +69,7 @@ instance Arbitrary DecPrintCap where
6969 n <- choose (1,9)
7070 (s', bytes) <- insertEscapeOp ("p" ++ show n ++ "%d") [] s
7171 return $ DecPrintCap s' n bytes
72− ) `suchThat` ( \(DecPrintCap str _ _) -> length str < 255 )
72+ ) `suchThat` ( \(DecPrintCap str _ _) -> length str < 255 )
7373
7474insertEscapeOp opStr replBytes s = do
7575 insertPoints <- listOf1 $ elements [0 .. length s - 1]
@@ -92,21 +92,20 @@ bytesForRange cap offset count
9292 = Vector.toList $ Vector.take count $ Vector.drop offset $ capBytes cap
9393
9494collectBytes :: CapExpression -> [Word8]
95−collectBytes e = concat [ bytes
95+collectBytes e = concat [ bytes
9696 | Bytes offset count <- capOps e
9797 , let bytes = bytesForRange e offset count
9898 ]
99−
99+
100100
101101verifyBytesEqual :: [Word8] -> [Word8] -> Result
102−verifyBytesEqual outBytes expectedBytes
102+verifyBytesEqual outBytes expectedBytes
103103 = if outBytes == expectedBytes
104104 then succeeded
105− else failed
106− { reason = "outBytes ["
105+ else failed
106+ { reason = "outBytes ["
107107 ++ hexDump outBytes
108108 ++ "] /= expectedBytes ["
109109 ++ hexDump expectedBytes
110110 ++ "]"
111111 }
112−
test/Verify/Graphics/Vty/Attributes.hs+2−3
@@ -40,8 +40,8 @@ allStyles =
4040
4141-- Limit the possible attributes to just a few for now.
4242possibleAttrMods :: [ AttrOp ]
43−possibleAttrMods =
44− [ idOp
43+possibleAttrMods =
44+ [ idOp
4545 ] ++ map setForeColorOp allColors
4646 ++ map setBackColorOp allColors
4747 ++ map setStyleOp allStyles
@@ -70,4 +70,3 @@ idOp = AttrOp "id" id
7070
7171applyOp :: AttrOp -> Attr -> Attr
7272applyOp (AttrOp _ f) a = f a
73−
test/Verify/Graphics/Vty/Image.hs+10−11
@@ -26,7 +26,7 @@ instance Show UnitImage where
2626data DefaultImage = DefaultImage Image
2727
2828instance Show DefaultImage where
29− show (DefaultImage i)
29+ show (DefaultImage i)
3030 = "DefaultImage (" ++ show i ++ ") " ++ show (imageWidth i, imageHeight i)
3131
3232instance Arbitrary DefaultImage where
@@ -34,15 +34,15 @@ instance Arbitrary DefaultImage where
3434 i <- return $ char defAttr 'X'
3535 return $ DefaultImage i
3636
37−data SingleRowSingleAttrImage
38− = SingleRowSingleAttrImage
37+data SingleRowSingleAttrImage
38+ = SingleRowSingleAttrImage
3939 { expectedAttr :: Attr
4040 , expectedColumns :: Int
4141 , rowImage :: Image
4242 }
4343
4444instance Show SingleRowSingleAttrImage where
45− show (SingleRowSingleAttrImage attr columns image)
45+ show (SingleRowSingleAttrImage attr columns image)
4646 = "SingleRowSingleAttrImage (" ++ show attr ++ ") " ++ show columns ++ " ( " ++ show image ++ " )"
4747
4848newtype WidthResize = WidthResize (Image -> (Image, Int))
@@ -84,14 +84,14 @@ instance Arbitrary ImageResize where
8484 , do
8585 ImageResize f <- arbitrary
8686 WidthResize g <- arbitrary
87− return $! ImageResize $! \i ->
87+ return $! ImageResize $! \i ->
8888 let (i0, (_, outHeight)) = f i
8989 gI = g i0
9090 in (fst gI, (snd gI, outHeight))
9191 , do
9292 ImageResize f <- arbitrary
9393 HeightResize g <- arbitrary
94− return $! ImageResize $! \i ->
94+ return $! ImageResize $! \i ->
9595 let (i0, (outWidth, _)) = f i
9696 gI = g i0
9797 in (fst gI, (outWidth, snd gI))
@@ -109,8 +109,8 @@ instance Arbitrary SingleRowSingleAttrImage where
109109 outWidth = length singleColumnRowText
110110 return $ SingleRowSingleAttrImage a outWidth outImage
111111
112−data SingleRowTwoAttrImage
113− = SingleRowTwoAttrImage
112+data SingleRowTwoAttrImage
113+ = SingleRowTwoAttrImage
114114 { part0 :: SingleRowSingleAttrImage
115115 , part1 :: SingleRowSingleAttrImage
116116 , joinImage :: Image
@@ -122,8 +122,8 @@ instance Arbitrary SingleRowTwoAttrImage where
122122 p1 <- arbitrary
123123 return $ SingleRowTwoAttrImage p0 p1 (rowImage p0 <|> rowImage p1)
124124
125−data SingleAttrSingleSpanStack = SingleAttrSingleSpanStack
126− { stackImage :: Image
125+data SingleAttrSingleSpanStack = SingleAttrSingleSpanStack
126+ { stackImage :: Image
127127 , stackSourceImages :: [SingleRowSingleAttrImage]
128128 , stackWidth :: Int
129129 , stackHeight :: Int
@@ -215,4 +215,3 @@ instance Arbitrary Translation where
215215 y <- arbitrary `suchThat` (> 0)
216216 let i' = translate x y i
217217 return $ Translation i (x,y) i'
218−
test/Verify/Graphics/Vty/Output.hs+1−2
@@ -15,7 +15,7 @@ import Test.QuickCheck.Property
1515-- not be supported were removed. Then a few more were pruned until a reasonable looking set was
1616-- made.
1717terminalsOfInterest :: [String]
18−terminalsOfInterest =
18+terminalsOfInterest =
1919 [ "vt100"
2020 , "vt220"
2121 , "vt102"
@@ -58,4 +58,3 @@ compareMockOutput mockData expectedStr = do
5858 ++ expectedStr
5959 }
6060 else return succeeded
61−
test/Verify/Graphics/Vty/Picture.hs+8−9
@@ -14,9 +14,9 @@ import Verify.Graphics.Vty.Image
1414
1515import Verify
1616
17−data DefaultPic = DefaultPic
17+data DefaultPic = DefaultPic
1818 { defaultPic :: Picture
19− , defaultWin :: MockWindow
19+ , defaultWin :: MockWindow
2020 }
2121
2222instance Show DefaultPic where
@@ -27,10 +27,10 @@ instance Arbitrary DefaultPic where
2727 arbitrary = do
2828 DefaultImage image <- arbitrary
2929 let win = MockWindow (imageWidth image) (imageHeight image)
30− return $ DefaultPic (picForImage image)
31− win
30+ return $ DefaultPic (picForImage image)
31+ win
3232
33−data PicWithBGAttr = PicWithBGAttr
33+data PicWithBGAttr = PicWithBGAttr
3434 { withAttrPic :: Picture
3535 , withAttrWin :: MockWindow
3636 , withAttrSpecifiedAttr :: Attr
@@ -41,12 +41,11 @@ instance Arbitrary PicWithBGAttr where
4141 DefaultImage image <- arbitrary
4242 let win = MockWindow (imageWidth image) (imageHeight image)
4343 attr <- arbitrary
44− return $ PicWithBGAttr (picForImage image)
45− win
44+ return $ PicWithBGAttr (picForImage image)
45+ win
4646 attr
47−
47+
4848instance Arbitrary Picture where
4949 arbitrary = do
5050 layers <- Verify.resize 20 (listOf1 arbitrary)
5151 return $ picForLayers layers
52−
test/Verify/Graphics/Vty/Span.hs+1−2
@@ -22,7 +22,7 @@ verifyAllSpansHaveWidth i spans w
2222 = let v = map (\s -> (spanOpsEffectedColumns s /= w, s)) (Vector.toList spans)
2323 in case any ((== True) . fst) v of
2424 False -> succeeded
25− True -> failed { reason = "Not all spans contained operations defining exactly "
25+ True -> failed { reason = "Not all spans contained operations defining exactly "
2626 ++ show w
2727 ++ " columns of output - \n"
2828 ++ (concatMap ((++ "\n") . show)) v
@@ -34,4 +34,3 @@ verifyOpsEquality i_ops i_alt_ops =
3434 else failed { reason = "ops for alternate image " ++ show i_alt_ops
3535 ++ " are not the same as " ++ show i_ops
3636 }
37−
test/VerifyCropSpanGeneration.hs+2−3
@@ -13,7 +13,7 @@ import Graphics.Vty.PictureToSpans
1313
1414import Verify
1515
16−import qualified Data.Vector as Vector
16+import qualified Data.Vector as Vector
1717
1818cropOpDisplayOps :: (Int -> Image -> Image) ->
1919 Int -> Image -> (DisplayOps, Image)
@@ -75,7 +75,7 @@ cropTopAndBottomRejoinedEquivalence stack = imageHeight (stackImage stack) `mod`
7575 in displayOpsForImage i == displayOpsForImage iAlt
7676
7777tests :: IO [Test]
78−tests = return
78+tests = return
7979 [ verify "cropping from the bottom produces display operations covering the expected rows"
8080 cropBottomOutputRows
8181 , verify "cropping from the top produces display operations covering the expected rows"
@@ -90,4 +90,3 @@ tests = return
9090 , verify "the output of a stack is the same as that stack cropped top & bottom and joined together"
9191 cropTopAndBottomRejoinedEquivalence
9292 ]
93−
test/VerifyEvalTerminfoCaps.hs+9−9
@@ -3,7 +3,7 @@
33module VerifyEvalTerminfoCaps where
44
55import Blaze.ByteString.Builder.Internal.Write (runWrite, getBound)
6−import Data.Terminfo.Eval
6+import Data.Terminfo.Eval
77import Data.Terminfo.Parse
88import Control.DeepSeq
99
@@ -25,7 +25,7 @@ import Foreign.Ptr (Ptr, minusPtr)
2525import Numeric
2626
2727-- If a terminal defines one of the caps then it's expected to be parsable.
28−capsOfInterest =
28+capsOfInterest =
2929 [ "cup"
3030 , "sc"
3131 , "rc"
@@ -54,7 +54,7 @@ tests = do
5454 putStrLn $ "adding tests for terminal: " ++ termName
5555 mti <- try $ Terminfo.setupTerm termName
5656 case mti of
57− Left (_e :: SomeException)
57+ Left (_e :: SomeException)
5858 -> return []
5959 Right ti -> do
6060 fmap concat $ forM capsOfInterest $ \capName -> do
@@ -71,7 +71,7 @@ tests = do
7171{-# NOINLINE verifyEvalCap #-}
7272verifyEvalCap :: Ptr Word8 -> CapExpression -> Int -> Property
7373verifyEvalCap evalBuffer expr !junkInt = do
74− forAll (vector 9) $ \inputValues ->
74+ forAll (vector 9) $ \inputValues ->
7575 let write = writeCapExpr expr inputValues
7676 !byteCount = getBound write
7777 in liftIOResult $ do
@@ -79,12 +79,12 @@ verifyEvalCap evalBuffer expr !junkInt = do
7979 forM_ [0..100] $ \i -> runWrite write startPtr
8080 endPtr <- runWrite write startPtr
8181 case endPtr `minusPtr` startPtr of
82− count | count < 0 ->
82+ count | count < 0 ->
8383 return $ failed { reason = "End pointer before start pointer." }
84− | toEnum count > byteCount ->
85− return $ failed { reason = "End pointer past end of buffer by "
86− ++ show (toEnum count - byteCount)
84+ | toEnum count > byteCount ->
85+ return $ failed { reason = "End pointer past end of buffer by "
86+ ++ show (toEnum count - byteCount)
8787 }
88− | otherwise ->
88+ | otherwise ->
8989 return succeeded
9090
test/VerifyImageOps.hs+25−26
@@ -9,43 +9,43 @@ import Verify
99import Control.DeepSeq
1010
1111twoSwHorizConcat :: SingleColumnChar -> SingleColumnChar -> Bool
12−twoSwHorizConcat (SingleColumnChar c1) (SingleColumnChar c2) =
12+twoSwHorizConcat (SingleColumnChar c1) (SingleColumnChar c2) =
1313 imageWidth (char defAttr c1 <|> char defAttr c2) == 2
1414
1515manySwHorizConcat :: [SingleColumnChar] -> Bool
16−manySwHorizConcat cs =
16+manySwHorizConcat cs =
1717 let chars = [ char | SingleColumnChar char <- cs ]
1818 l = fromIntegral $ length cs
1919 in imageWidth ( horizCat $ map (char defAttr) chars ) == l
2020
2121twoSwVertConcat :: SingleColumnChar -> SingleColumnChar -> Bool
22−twoSwVertConcat (SingleColumnChar c1) (SingleColumnChar c2) =
22+twoSwVertConcat (SingleColumnChar c1) (SingleColumnChar c2) =
2323 imageHeight (char defAttr c1 <-> char defAttr c2) == 2
2424
2525horizConcatSwAssoc :: SingleColumnChar -> SingleColumnChar -> SingleColumnChar -> Bool
26−horizConcatSwAssoc (SingleColumnChar c0) (SingleColumnChar c1) (SingleColumnChar c2) =
27− (char defAttr c0 <|> char defAttr c1) <|> char defAttr c2
28− ==
26+horizConcatSwAssoc (SingleColumnChar c0) (SingleColumnChar c1) (SingleColumnChar c2) =
27+ (char defAttr c0 <|> char defAttr c1) <|> char defAttr c2
28+ ==
2929 char defAttr c0 <|> (char defAttr c1 <|> char defAttr c2)
3030
3131twoDwHorizConcat :: DoubleColumnChar -> DoubleColumnChar -> Bool
32−twoDwHorizConcat (DoubleColumnChar c1) (DoubleColumnChar c2) =
32+twoDwHorizConcat (DoubleColumnChar c1) (DoubleColumnChar c2) =
3333 imageWidth (char defAttr c1 <|> char defAttr c2) == 4
3434
3535manyDwHorizConcat :: [DoubleColumnChar] -> Bool
36−manyDwHorizConcat cs =
36+manyDwHorizConcat cs =
3737 let chars = [ char | DoubleColumnChar char <- cs ]
3838 l = fromIntegral $ length cs
3939 in imageWidth ( horizCat $ map (char defAttr) chars ) == l * 2
4040
4141twoDwVertConcat :: DoubleColumnChar -> DoubleColumnChar -> Bool
42−twoDwVertConcat (DoubleColumnChar c1) (DoubleColumnChar c2) =
42+twoDwVertConcat (DoubleColumnChar c1) (DoubleColumnChar c2) =
4343 imageHeight (char defAttr c1 <-> char defAttr c2) == 2
4444
4545horizConcatDwAssoc :: DoubleColumnChar -> DoubleColumnChar -> DoubleColumnChar -> Bool
46−horizConcatDwAssoc (DoubleColumnChar c0) (DoubleColumnChar c1) (DoubleColumnChar c2) =
47− (char defAttr c0 <|> char defAttr c1) <|> char defAttr c2
48− ==
46+horizConcatDwAssoc (DoubleColumnChar c0) (DoubleColumnChar c1) (DoubleColumnChar c2) =
47+ (char defAttr c0 <|> char defAttr c1) <|> char defAttr c2
48+ ==
4949 char defAttr c0 <|> (char defAttr c1 <|> char defAttr c2)
5050
5151vertContatSingleRow :: NonEmptyList SingleRowSingleAttrImage -> Bool
@@ -54,9 +54,9 @@ vertContatSingleRow (NonEmpty stack) =
5454 stackImage = vertCat [ i | SingleRowSingleAttrImage { rowImage = i } <- stack ]
5555 in imageHeight stackImage == expectedHeight
5656
57−disjointHeightHorizJoin :: NonEmptyList SingleRowSingleAttrImage
58− -> NonEmptyList SingleRowSingleAttrImage
59− -> Bool
57+disjointHeightHorizJoin :: NonEmptyList SingleRowSingleAttrImage
58+ -> NonEmptyList SingleRowSingleAttrImage
59+ -> Bool
6060disjointHeightHorizJoin (NonEmpty stack0) (NonEmpty stack1) =
6161 let expectedHeight :: Int = max (length stack0) (length stack1)
6262 stackImage0 = vertCat [ i | SingleRowSingleAttrImage { rowImage = i } <- stack0 ]
@@ -64,9 +64,9 @@ disjointHeightHorizJoin (NonEmpty stack0) (NonEmpty stack1) =
6464 in imageHeight (stackImage0 <|> stackImage1) == expectedHeight
6565
6666
67−disjointHeightHorizJoinBgFill :: NonEmptyList SingleRowSingleAttrImage
68− -> NonEmptyList SingleRowSingleAttrImage
69− -> Bool
67+disjointHeightHorizJoinBgFill :: NonEmptyList SingleRowSingleAttrImage
68+ -> NonEmptyList SingleRowSingleAttrImage
69+ -> Bool
7070disjointHeightHorizJoinBgFill (NonEmpty stack0) (NonEmpty stack1) =
7171 let stackImage0 = vertCat [ i | SingleRowSingleAttrImage { rowImage = i } <- stack0 ]
7272 stackImage1 = vertCat [ i | SingleRowSingleAttrImage { rowImage = i } <- stack1 ]
@@ -74,31 +74,31 @@ disjointHeightHorizJoinBgFill (NonEmpty stack0) (NonEmpty stack1) =
7474 expectedHeight = imageHeight image
7575 in case image of
7676 HorizJoin {} -> ( expectedHeight == (imageHeight $ partLeft image) )
77− &&
77+ &&
7878 ( expectedHeight == (imageHeight $ partRight image) )
7979 _ -> True
8080
81−disjointWidthVertJoin :: NonEmptyList SingleRowSingleAttrImage
81+disjointWidthVertJoin :: NonEmptyList SingleRowSingleAttrImage
8282 -> NonEmptyList SingleRowSingleAttrImage
8383 -> Bool
8484disjointWidthVertJoin (NonEmpty stack0) (NonEmpty stack1) =
8585 let expectedWidth = maximum $ map imageWidth (stack0Images ++ stack1Images)
8686 stack0Images = [ i | SingleRowSingleAttrImage { rowImage = i } <- stack0 ]
8787 stack1Images = [ i | SingleRowSingleAttrImage { rowImage = i } <- stack1 ]
88− stack0Image = vertCat stack0Images
89− stack1Image = vertCat stack1Images
88+ stack0Image = vertCat stack0Images
89+ stack1Image = vertCat stack1Images
9090 image = stack0Image <-> stack1Image
9191 in imageWidth image == expectedWidth
9292
93−disjointWidthVertJoinBgFill :: NonEmptyList SingleRowSingleAttrImage
93+disjointWidthVertJoinBgFill :: NonEmptyList SingleRowSingleAttrImage
9494 -> NonEmptyList SingleRowSingleAttrImage
9595 -> Bool
9696disjointWidthVertJoinBgFill (NonEmpty stack0) (NonEmpty stack1) =
9797 let expectedWidth = maximum $ map imageWidth (stack0Images ++ stack1Images)
9898 stack0Images = [ i | SingleRowSingleAttrImage { rowImage = i } <- stack0 ]
9999 stack1Images = [ i | SingleRowSingleAttrImage { rowImage = i } <- stack1 ]
100− stack0Image = vertCat stack0Images
101− stack1Image = vertCat stack1Images
100+ stack0Image = vertCat stack0Images
101+ stack1Image = vertCat stack1Images
102102 image = stack0Image <-> stack1Image
103103 in case image of
104104 VertJoin {} -> ( expectedWidth == (imageWidth $ partTop image) )
@@ -171,4 +171,3 @@ tests = return
171171 , verify "can rnf image" canRnfImage
172172 , verify "can pp image" canPpImage
173173 ]
174−
test/VerifyImageTrans.hs+1−1
@@ -22,7 +22,7 @@ verifyHorizContatWAttrChangeSimplifies :: SingleRowTwoAttrImage -> Bool
2222verifyHorizContatWAttrChangeSimplifies ( SingleRowTwoAttrImage (SingleRowSingleAttrImage attr0 charCount0 _image0)
2323 (SingleRowSingleAttrImage attr1 charCount1 _image1)
2424 i
25− )
25+ )
2626 | charCount0 == 0 || charCount1 == 0 || attr0 == attr1 = isHorizTextOfColumns i (charCount0 + charCount1)
2727 | otherwise = False == isHorizTextOfColumns i (charCount0 + charCount1)
2828
test/VerifyLayersSpanGeneration.hs+2−2
@@ -13,7 +13,7 @@ import Graphics.Vty.PictureToSpans
1313
1414import Verify
1515
16−import qualified Data.Vector as Vector
16+import qualified Data.Vector as Vector
1717
1818largerHorizSpanOcclusion :: SingleRowSingleAttrImage -> SingleRowSingleAttrImage -> Result
1919largerHorizSpanOcclusion row0 row1 =
@@ -109,7 +109,7 @@ horizJoinAlternate1 =
109109 in verifyOpsEquality expectedOps opsLayered
110110
111111tests :: IO [Test]
112−tests = return
112+tests = return
113113 [ verify "a larger horiz span occludes a smaller span on a lower layer"
114114 largerHorizSpanOcclusion
115115 , verify "two rows stack vertical equiv to first image layered on top of second with padding (0)"
test/VerifyParseTerminfoCaps.hs+3−4
@@ -16,7 +16,7 @@ import Numeric
1616
1717-- If a terminal defines one of the caps then it's expected to be parsable.
1818-- TODO: reduce duplication with terminfo terminal implementation.
19−capsOfInterest =
19+capsOfInterest =
2020 [ "cup"
2121 , "sc"
2222 , "rc"
@@ -65,7 +65,7 @@ verifyParseCap capString onParse =
6565 Right e -> onParse e
6666
6767nonParamaterizedCaps (NonParamCapString cap) = do
68− verifyParseCap cap $ \e ->
68+ verifyParseCap cap $ \e ->
6969 let expectedBytes = map (toEnum . fromEnum) cap
7070 outBytes = bytesForRange e 0 (length cap)
7171 in verifyBytesEqual outBytes expectedBytes
@@ -75,7 +75,7 @@ literalPercentCaps (LiteralPercentCap capString expectedBytes) = do
7575
7676incFirstTwoCaps (IncFirstTwoCap capString expectedBytes) = do
7777 verifyParseCap capString $ \e -> verifyBytesEqual (collectBytes e) expectedBytes
78−
78+
7979pushParamCaps (PushParamCap capString expectedParamCount expectedBytes) = do
8080 verifyParseCap capString $ \e ->
8181 let outBytes = collectBytes e
@@ -98,4 +98,3 @@ printCap ti capName = do
9898printExpression ti capName = do
9999 let parseResult = parseCapExpression $ fromCapname ti capName
100100 putStrLn $ capName ++ ": " ++ show parseResult
101−
test/VerifySimpleSpanGeneration.hs+8−8
@@ -13,28 +13,28 @@ import Graphics.Vty.PictureToSpans
1313
1414import Verify
1515
16−import qualified Data.Vector as Vector
16+import qualified Data.Vector as Vector
1717
1818unitImageAndZeroWindow0 :: UnitImage -> EmptyWindow -> Bool
19−unitImageAndZeroWindow0 (UnitImage _ i) (EmptyWindow w) =
19+unitImageAndZeroWindow0 (UnitImage _ i) (EmptyWindow w) =
2020 let p = picForImage i
2121 ops = displayOpsForPic p (regionForWindow w)
2222 in displayOpsColumns ops == 0 && displayOpsRows ops == 0
2323
2424unitImageAndZeroWindow1 :: UnitImage -> EmptyWindow -> Bool
25−unitImageAndZeroWindow1 (UnitImage _ i) (EmptyWindow w) =
25+unitImageAndZeroWindow1 (UnitImage _ i) (EmptyWindow w) =
2626 let p = picForImage i
2727 ops = displayOpsForPic p (regionForWindow w)
2828 in ( spanOpsEffectedRows ops == 0 ) && ( allSpansHaveWidth ops 0 )
2929
3030horizSpanImageAndZeroWindow0 :: SingleRowSingleAttrImage -> EmptyWindow -> Bool
31−horizSpanImageAndZeroWindow0 (SingleRowSingleAttrImage { rowImage = i }) (EmptyWindow w) =
31+horizSpanImageAndZeroWindow0 (SingleRowSingleAttrImage { rowImage = i }) (EmptyWindow w) =
3232 let p = picForImage i
3333 ops = displayOpsForPic p (regionForWindow w)
3434 in displayOpsColumns ops == 0 && displayOpsRows ops == 0
3535
3636horizSpanImageAndZeroWindow1 :: SingleRowSingleAttrImage -> EmptyWindow -> Bool
37−horizSpanImageAndZeroWindow1 (SingleRowSingleAttrImage { rowImage = i }) (EmptyWindow w) =
37+horizSpanImageAndZeroWindow1 (SingleRowSingleAttrImage { rowImage = i }) (EmptyWindow w) =
3838 let p = picForImage i
3939 ops = displayOpsForPic p (regionForWindow w)
4040 in ( spanOpsEffectedRows ops == 0 ) && ( allSpansHaveWidth ops 0 )
@@ -139,7 +139,7 @@ spanOpsActuallyFillColumns (DefaultPic pic win) =
139139 in allSpansHaveWidth ops expectedColumnCount
140140
141141firstSpanOpSetsAttr :: DefaultPic -> Bool
142−firstSpanOpSetsAttr DefaultPic { defaultPic = pic, defaultWin = win } =
142+firstSpanOpSetsAttr DefaultPic { defaultPic = pic, defaultWin = win } =
143143 let ops = displayOpsForPic pic (regionForWindow win)
144144 in all ( isAttrSpanOp . Vector.head ) ( Vector.toList ops )
145145
@@ -158,7 +158,7 @@ imageCoverageMatchesBounds i =
158158 in verifyAllSpansHaveWidth i ops (imageWidth i)
159159
160160tests :: IO [Test]
161−tests = return
161+tests = return
162162 [ verify "unit image is cropped when window size == (0,0) [0]" unitImageAndZeroWindow0
163163 , verify "unit image is cropped when window size == (0,0) [1]" unitImageAndZeroWindow1
164164 , verify "horiz span image is cropped when window size == (0,0) [0]" horizSpanImageAndZeroWindow0
@@ -171,7 +171,7 @@ tests = return
171171 , verify "a stack of single attr text spans should define content for all the columns [output region == size of stack]"
172172 singleAttrSingleSpanStackOpCoverage
173173 , verify "a single attr text span is cropped when window size < size of stack image [width]"
174− singleAttrSingleSpanStackCropped0
174+ singleAttrSingleSpanStackCropped0
175175 , verify "a single attr text span is cropped when window size < size of stack image [height]"
176176 singleAttrSingleSpanStackCropped1
177177 , verify "single attr text span <|> single attr text span display cropped. [width]"
test/VerifyUsingMockTerminal.hs+1−1
@@ -49,7 +49,7 @@ singleTRow (MockWindow w h) = liftIOResult $ do
4949 let expected = "H" ++ "MDA" ++ replicate (fromEnum w) 'T'
5050 ++ concat (replicate (fromEnum h - 1) $ "MDA" ++ replicate (fromEnum w) 'B')
5151 compareMockOutput mockData expected
52−
52+
5353manyTRows :: MockWindow -> Property
5454manyTRows (MockWindow w h) = liftIOResult $ do
5555 (mockData, t) <- mockTerminal (w,h)
test/interactive_terminal_test.hs+49−49
@@ -19,7 +19,7 @@ import Data.Monoid
1919import Data.String.QQ
2020import Data.Word
2121
22−import Foreign.Marshal.Array
22+import Foreign.Marshal.Array
2323
2424import qualified System.Environment as Env
2525
@@ -74,12 +74,12 @@ with the test_results.list file pasted into the issue. A suitable summary is:
7474|]
7575 waitForReturn
7676 results <- doTestMenu 1
77− envAttributes <- mapM ( \envName -> Control.Exception.catch ( Env.getEnv envName >>= return . (,) envName )
78− ( \ (_ :: SomeException) -> return (envName, "") )
79− )
77+ envAttributes <- mapM ( \envName -> Control.Exception.catch ( Env.getEnv envName >>= return . (,) envName )
78+ ( \ (_ :: SomeException) -> return (envName, "") )
79+ )
8080 [ "TERM", "COLORTERM", "LANG", "TERM_PROGRAM", "XTERM_VERSION" ]
8181 t <- standardIOConfig >>= outputForConfig
82− let resultsTxt = show envAttributes ++ "\n"
82+ let resultsTxt = show envAttributes ++ "\n"
8383 ++ terminalID t ++ "\n"
8484 ++ show results ++ "\n"
8585 releaseTerminal t
@@ -94,7 +94,7 @@ testMenu :: [(String, Test)]
9494testMenu = zip (map show [1..]) allTests
9595
9696doTestMenu :: Int -> IO [(String, Bool)]
97−doTestMenu nextID
97+doTestMenu nextID
9898 | nextID > length allTests = do
9999 putStrLn $ "Done! Please email the " ++ outputFilePath ++ " file to coreyoconnor@gmail.com"
100100 return []
@@ -108,26 +108,26 @@ doTestMenu nextID
108108 s <- getLine >>= return . filter (/= '\n')
109109 case s of
110110 "q" -> return mempty
111− "" -> do
112− r <- runTest $ show nextID
111+ "" -> do
112+ r <- runTest $ show nextID
113113 rs <- doTestMenu ( nextID + 1 )
114114 return $ r : rs
115115 i | isJust ( lookup i testMenu ) -> do
116− r <- runTest i
116+ r <- runTest i
117117 rs <- doTestMenu ( read i + 1 )
118118 return $ r : rs
119119 where
120− displayTestMenu
120+ displayTestMenu
121121 = mapM_ displayTestMenu' testMenu
122− displayTestMenu' ( i, t )
123− = putStrLn $ ( if i == show nextID
124− then "> "
122+ displayTestMenu' ( i, t )
123+ = putStrLn $ ( if i == show nextID
124+ then "> "
125125 else " "
126126 ) ++ i ++ ". " ++ testName t
127127
128128runTest :: String -> IO (String, Bool)
129129runTest i = do
130− let t = fromJust $ lookup i testMenu
130+ let t = fromJust $ lookup i testMenu
131131 printSummary t
132132 waitForReturn
133133 testAction t
@@ -153,8 +153,8 @@ data Test = Test
153153 , confirmResults :: IO Bool
154154 }
155155
156−allTests
157− = [ reserveOutputTest
156+allTests
157+ = [ reserveOutputTest
158158 , displayBoundsTest0
159159 , displayBoundsTest1
160160 , displayBoundsTest2
@@ -185,7 +185,7 @@ allTests
185185 , layer1
186186 ]
187187
188−reserveOutputTest = Test
188+reserveOutputTest = Test
189189 { testName = "Initialize and reserve terminal output then restore previous state."
190190 , testID = "reserveOutputTest"
191191 , testAction = do
@@ -203,7 +203,7 @@ reserveOutputTest = Test
203203 , printSummary = do
204204 putStr $ [s|
205205Once return is pressed:
206− 0. The screen will be cleared.
206+ 0. The screen will be cleared.
207207 1. Four lines of text should be visible.
208208 1. The cursor should be visible and at the start of the fifth line.
209209
@@ -391,7 +391,7 @@ utf8Txt0 = [ [ 0xe2 , 0x86 , 0x91 ]
391391
392392iso10646Txt0 :: String
393393iso10646Txt0 = map toEnum
394− [ 8593
394+ [ 8593
395395 , 8593
396396 , 8595
397397 , 8595
@@ -554,11 +554,11 @@ After return is pressed for the second time:
554554allColors = zip [ black, red, green, yellow, blue, magenta, cyan, white ]
555555 [ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" ]
556556
557−allBrightColors
557+allBrightColors
558558 = zip [ brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite ]
559559 [ "bright black", "bright red", "bright green", "bright yellow", "bright blue", "bright magenta", "bright cyan", "bright white" ]
560560
561−attributesTest0 = Test
561+attributesTest0 = Test
562562 { testName = "Character attributes: foreground colors."
563563 , testID = "attributesTest0"
564564 , testAction = do
@@ -604,7 +604,7 @@ Did the test output match the description?
604604 defaultSuccessConfirmResults
605605 }
606606
607−attributesTest1 = Test
607+attributesTest1 = Test
608608 { testName = "Character attributes: background colors."
609609 , testID = "attributesTest1"
610610 , testAction = do
@@ -659,7 +659,7 @@ Did the test output match the description?
659659 defaultSuccessConfirmResults
660660 }
661661
662−attributesTest2 = Test
662+attributesTest2 = Test
663663 { testName = "Character attributes: Vivid foreground colors."
664664 , testID = "attributesTest2"
665665 , testAction = do
@@ -686,23 +686,23 @@ Once return is pressed:
686686 1. The cursor will be hidden.
687687 2. 9 lines of text in three columns will be drawn:
688688 a. The first column will be a name of a standard color (for an 8 color
689− terminal) rendered with that color as the foreground color.
689+ terminal) rendered with that color as the foreground color.
690690 b. The next column will be also be the name of a standard color rendered
691691 with that color as the foreground color but the shade used should be
692− more vivid than the shade used in the first column.
692+ more vivid than the shade used in the first column.
693693 c. The final column will be the name of a color rendered with the
694694 default attributes.
695695
696696For instance, one line will be the word "magenta" and that word should be
697−rendered in the magenta color.
697+rendered in the magenta color.
698698
699699I'm not actually sure exactly what "vivid" means in this context. For xterm the
700−vivid colors are brighter.
700+vivid colors are brighter.
701701
702−Verify:
702+Verify:
703703 * The first column: The foreground color matches the named color.
704704 * The second column: The foreground color matches the named color but is
705− more vivid than the color used in the first column.
705+ more vivid than the color used in the first column.
706706 * The third column: All text is rendered with the default attributes.
707707 * The vertical bars used in each line to mark the border of a column are
708708 lined up.
@@ -718,7 +718,7 @@ Did the test output match the description?
718718 defaultSuccessConfirmResults
719719 }
720720
721−attributesTest3 = Test
721+attributesTest3 = Test
722722 { testName = "Character attributes: Vivid background colors."
723723 , testID = "attributesTest3"
724724 , testAction = do
@@ -746,23 +746,23 @@ Once return is pressed:
746746 2. 9 lines of text in three columns will be drawn:
747747 a. The first column will contain be a name of a standard color for an 8
748748 color terminal rendered with the default foreground color with a
749− background the named color.
749+ background the named color.
750750 b. The first column will contain be a name of a standard color for an 8
751751 color terminal rendered with the default foreground color with the
752− background a vivid version of the named color.
752+ background a vivid version of the named color.
753753 c. The third column will be the name of a standard color rendered with
754754 the default attributes.
755−
755+
756756For instance, one line will contain be the word "magenta" and the word should
757−be rendered in the default foreground color over a magenta background.
757+be rendered in the default foreground color over a magenta background.
758758
759759I'm not actually sure exactly what "vivid" means in this context. For xterm the
760760vivid colors are brighter.
761761
762−Verify:
762+Verify:
763763 * The first column: The background color matches the named color.
764764 * The second column: The background color matches the named color and is
765− more vivid than the color used in the first column.
765+ more vivid than the color used in the first column.
766766 * The third column column: All text is rendered with the default attributes.
767767 * The vertical bars used in each line to mark the border of a column are
768768 lined up.
@@ -785,7 +785,7 @@ Did the test output match the description?
785785 defaultSuccessConfirmResults
786786 }
787787
788−attrCombos =
788+attrCombos =
789789 [ ( "default", id )
790790 , ( "bold", flip withStyle bold )
791791 , ( "blink", flip withStyle blink )
@@ -796,7 +796,7 @@ attrCombos =
796796 , ( "bold + blink + underline", flip withStyle (bold + blink + underline) )
797797 ]
798798
799−attributesTest4 = Test
799+attributesTest4 = Test
800800 { testName = "Character attributes: Bold; Blink; Underline."
801801 , testID = "attributesTest4"
802802 , testAction = do
@@ -819,10 +819,10 @@ attributesTest4 = Test
819819Once return is pressed:
820820 0. The screen will be cleared.
821821 1. The cursor will be hidden.
822− 2. 8 rows of text in two columns.
822+ 2. 8 rows of text in two columns.
823823 The rows will contain the following text:
824824 default
825− bold
825+ bold
826826 blink
827827 underline
828828 bold + blink
@@ -831,8 +831,8 @@ Once return is pressed:
831831 bold + blink + underline
832832 The first column will be rendered with the described attributes. The second
833833 column will be rendered with the default attributes.
834−
835−Verify:
834+
835+Verify:
836836 * The vertical bars used in each line to mark the border of a column are
837837 lined up.
838838 * The text in the first column is rendered as described.
@@ -848,7 +848,7 @@ Did the test output match the description?
848848 defaultSuccessConfirmResults
849849 }
850850
851−attributesTest5 = Test
851+attributesTest5 = Test
852852 { testName = "Character attributes: 240 color palette"
853853 , testID = "attributesTest5"
854854 , testAction = do
@@ -873,7 +873,7 @@ Once return is pressed:
873873 2. A 20 character wide and 12 row high block of color squares. This should look like a palette
874874 of some sort. I'm not exactly sure if all color terminals use the same palette. I doubt it...
875875
876−Verify:
876+Verify:
877877
878878After return is pressed for the second time:
879879 0. The screen containing the test summary should be restored.
@@ -971,7 +971,7 @@ outputPicAndWait pic = do
971971 releaseDisplay t
972972 releaseTerminal t
973973 return ()
974−
974+
975975vertCropTest0 :: Test
976976vertCropTest0 = Test
977977 { testName = "Verify bottom cropping works as expected with single column chars"
@@ -1046,7 +1046,7 @@ horizCropTest0 = Test
10461046 , testID = "cropTest0"
10471047 , testAction = do
10481048 let baseImage = vertCat $ map (string defAttr) lorumIpsum
1049− croppedImage = cropRight (imageWidth baseImage `div` 2) baseImage
1049+ croppedImage = cropRight (imageWidth baseImage `div` 2) baseImage
10501050 image = baseImage <-> backgroundFill 10 2 <-> croppedImage
10511051 outputImageAndWait image
10521052 , printSummary = putStr $ [s|
@@ -1063,7 +1063,7 @@ horizCropTest1 = Test
10631063 , testID = "cropTest0"
10641064 , testAction = do
10651065 let baseImage = vertCat $ map (string defAttr) lorumIpsumChinese
1066− croppedImage = cropRight (imageWidth baseImage `div` 2) baseImage
1066+ croppedImage = cropRight (imageWidth baseImage `div` 2) baseImage
10671067 image = baseImage <-> backgroundFill 10 2 <-> croppedImage
10681068 outputImageAndWait image
10691069 , printSummary = putStr $ [s|
@@ -1080,7 +1080,7 @@ horizCropTest2 = Test
10801080 , testID = "cropTest0"
10811081 , testAction = do
10821082 let baseImage = vertCat $ map (string defAttr) lorumIpsum
1083− croppedImage = cropLeft (imageWidth baseImage `div` 2) baseImage
1083+ croppedImage = cropLeft (imageWidth baseImage `div` 2) baseImage
10841084 image = baseImage <-> backgroundFill 10 2 <-> croppedImage
10851085 outputImageAndWait image
10861086 , printSummary = putStr $ [s|
@@ -1097,7 +1097,7 @@ horizCropTest3 = Test
10971097 , testID = "cropTest0"
10981098 , testAction = do
10991099 let baseImage = vertCat $ map (string defAttr) lorumIpsumChinese
1100− croppedImage = cropLeft (imageWidth baseImage `div` 2) baseImage
1100+ croppedImage = cropLeft (imageWidth baseImage `div` 2) baseImage
11011101 image = baseImage <-> backgroundFill 10 2 <-> croppedImage
11021102 outputImageAndWait image
11031103 , printSummary = putStr $ [s|