This commit is contained in:
Eric Lindblad 2022-03-23 11:49:10 -05:00
parent a8fb6a38fc
commit eff775ced7
12 changed files with 16 additions and 16 deletions

View File

@ -31,7 +31,7 @@ introText = vertCat $ map (string defAttr)
[ "this line is hidden by the top layer" [ "this line is hidden by the top layer"
, "The vty demo program will echo the events generated by the pressed keys." , "The vty demo program will echo the events generated by the pressed keys."
, "Below there is a 240 color box." , "Below there is a 240 color box."
, "Followed by a description of the 16 color pallete." , "Followed by a description of the 16 color palette."
, "Followed by tones of red using a 24-bit palette." , "Followed by tones of red using a 24-bit palette."
, "If the 240 color box is not visible then the terminal" , "If the 240 color box is not visible then the terminal"
, "claims 240 colors are not supported." , "claims 240 colors are not supported."

View File

@ -95,7 +95,7 @@ import Graphics.Vty.Attributes.Color240
-- reported then the color reproduction will be incorrect. -- reported then the color reproduction will be incorrect.
-- --
-- If the terminal reports <= 16 colors then the 240 color palette -- If the terminal reports <= 16 colors then the 240 color palette
-- points are only mapped to the 8 color pallete. I'm not sure of -- points are only mapped to the 8 color palette. I'm not sure of
-- the RGB points for the "bright" colors which is why they are not -- the RGB points for the "bright" colors which is why they are not
-- addressable via the 240 color palette. -- addressable via the 240 color palette.
-- --

View File

@ -137,7 +137,7 @@ char a c =
let displayWidth = safeWcwidth c let displayWidth = safeWcwidth c
in HorizText a (TL.singleton c) displayWidth 1 in HorizText a (TL.singleton c) displayWidth 1
-- | Make an image from a string of characters layed out on a single -- | Make an image from a string of characters laid out on a single
-- row with the same display attribute. The string is assumed to be a -- row with the same display attribute. The string is assumed to be a
-- sequence of ISO-10646 characters. The input string should be -- sequence of ISO-10646 characters. The input string should be
-- sanitized of escape sequences (ASCII 27) and carriage returns; -- sanitized of escape sequences (ASCII 27) and carriage returns;

View File

@ -228,7 +228,7 @@ instance Monoid Image where
-- --
-- The result image will have a width equal to the sum of the two images -- The result image will have a width equal to the sum of the two images
-- width. And the height will equal the largest height of the two -- width. And the height will equal the largest height of the two
-- images. The area not defined in one image due to a height missmatch -- images. The area not defined in one image due to a height mismatch
-- will be filled with the background pattern. -- will be filled with the background pattern.
horizJoin :: Image -> Image -> Image horizJoin :: Image -> Image -> Image
horizJoin EmptyImage i = i horizJoin EmptyImage i = i
@ -259,7 +259,7 @@ horizJoin _ _ = error "horizJoin applied to undefined values."
-- --
-- The result image will have a height equal to the sum of the heights -- The result image will have a height equal to the sum of the heights
-- of both images. The width will equal the largest width of the two -- of both images. The width will equal the largest width of the two
-- images. The area not defined in one image due to a width missmatch -- images. The area not defined in one image due to a width mismatch
-- will be filled with the background pattern. -- will be filled with the background pattern.
vertJoin :: Image -> Image -> Image vertJoin :: Image -> Image -> Image
vertJoin EmptyImage i = i vertJoin EmptyImage i = i

View File

@ -77,7 +77,7 @@
-- The input encoding determines how UTF-8 encoded characters are -- The input encoding determines how UTF-8 encoded characters are
-- recognized. -- recognized.
-- --
-- * 7-bit mode: UTF-8 can be input unambiguiously. UTF-8 input is -- * 7-bit mode: UTF-8 can be input unambiguously. UTF-8 input is
-- a superset of ASCII. UTF-8 does not overlap escaped control key -- a superset of ASCII. UTF-8 does not overlap escaped control key
-- sequences. However, the escape key must be differentiated from -- sequences. However, the escape key must be differentiated from
-- escaped control key sequences by the timing of the input bytes. -- escaped control key sequences by the timing of the input bytes.
@ -95,7 +95,7 @@
-- --
-- == Terminal Input is Broken -- == Terminal Input is Broken
-- --
-- Clearly terminal input has fundemental issues. There is no easy way -- Clearly terminal input has fundamental issues. There is no easy way
-- to reliably resolve these issues. -- to reliably resolve these issues.
-- --
-- One resolution would be to ditch standard terminal interfaces -- One resolution would be to ditch standard terminal interfaces

View File

@ -89,7 +89,7 @@ scrollDown = 65
hasBitSet :: Int -> Int -> Bool hasBitSet :: Int -> Int -> Bool
hasBitSet val bit = val .&. bit > 0 hasBitSet val bit = val .&. bit > 0
-- | Attempt to lassify an input string as a mouse event. -- | Attempt to classify an input string as a mouse event.
classifyMouseEvent :: ByteString -> KClass classifyMouseEvent :: ByteString -> KClass
classifyMouseEvent s = runParser s $ do classifyMouseEvent s = runParser s $ do
when (not $ isMouseEvent s) failParse when (not $ isMouseEvent s) failParse
@ -102,7 +102,7 @@ classifyMouseEvent s = runParser s $ do
'M' -> classifyNormalMouseEvent 'M' -> classifyNormalMouseEvent
_ -> failParse _ -> failParse
-- Given a modifer/button value, determine which button was indicated -- Given a modifier/button value, determine which button was indicated
getSGRButton :: Int -> Parser Button getSGRButton :: Int -> Parser Button
getSGRButton mods = getSGRButton mods =
let buttonMap = [ (leftButton, BLeft) let buttonMap = [ (leftButton, BLeft)

View File

@ -78,7 +78,7 @@ outputForConfig config = (<> config) <$> standardIOConfig >>= outputForConfig
-- | Sets the cursor position to the given output column and row. -- | Sets the cursor position to the given output column and row.
-- --
-- This is not necessarially the same as the character position with the -- This is not necessarily the same as the character position with the
-- same coordinates. Characters can be a variable number of columns in -- same coordinates. Characters can be a variable number of columns in
-- width. -- width.
-- --

View File

@ -453,8 +453,8 @@ hardcodeColor side (r, g, b) =
-- | The color table used by a terminal is a 16 color set followed by a -- | The color table used by a terminal is a 16 color set followed by a
-- 240 color set that might not be supported by the terminal. -- 240 color set that might not be supported by the terminal.
-- --
-- This takes a Color which clearly identifies which pallete to use and -- This takes a Color which clearly identifies which palette to use and
-- computes the index into the full 256 color pallete. -- computes the index into the full 256 color palette.
ansiColorIndex :: Color -> Int ansiColorIndex :: Color -> Int
ansiColorIndex (ISOColor v) = fromEnum v ansiColorIndex (ISOColor v) = fromEnum v
ansiColorIndex (Color240 v) = 16 + fromEnum v ansiColorIndex (Color240 v) = 16 + fromEnum v

View File

@ -72,7 +72,7 @@ displayOpsForPic pic r = Vector.create (combinedOpsForLayers pic r)
-- | Returns the DisplayOps for an image rendered to a window the size -- | Returns the DisplayOps for an image rendered to a window the size
-- of the image. -- of the image.
-- --
-- largerly used only for debugging. -- largely used only for debugging.
displayOpsForImage :: Image -> DisplayOps displayOpsForImage :: Image -> DisplayOps
displayOpsForImage i = displayOpsForPic (picForImage i) (imageWidth i, imageHeight i) displayOpsForImage i = displayOpsForPic (picForImage i) (imageWidth i, imageHeight i)

View File

@ -137,7 +137,7 @@ cropBottomLimitsHeight :: Image -> Int -> Property
cropBottomLimitsHeight i v = v >= 0 ==> cropBottomLimitsHeight i v = v >= 0 ==>
v >= imageHeight (cropBottom v i) v >= imageHeight (cropBottom v i)
-- rediculous tests just to satisfy my desire for nice code coverage :-P -- ridiculous tests just to satisfy my desire for nice code coverage :-P
canShowImage :: Image -> Bool canShowImage :: Image -> Bool
canShowImage i = length (show i) > 0 canShowImage i = length (show i) > 0

View File

@ -1,4 +1,4 @@
-- We setup the environment to envoke certain terminals of interest. -- We setup the environment to invoke certain terminals of interest.
-- This assumes appropriate definitions exist in the current environment -- This assumes appropriate definitions exist in the current environment
-- for the terminals of interest. -- for the terminals of interest.
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ScopedTypeVariables #-}

View File

@ -364,7 +364,7 @@ Did the test output match the description?
|] |]
defaultSuccessConfirmResults defaultSuccessConfirmResults
-- Explicitely definethe bytes that encode each example text. -- Explicitly define the bytes that encode each example text.
-- This avoids any issues with how the compiler represents string literals. -- This avoids any issues with how the compiler represents string literals.
-- --
-- This document is UTF-8 encoded so the UTF-8 string is still included for -- This document is UTF-8 encoded so the UTF-8 string is still included for