1module VerifyUtf8Width where
5import Graphics.Text.Width
6import Graphics.Vty.Attributes
7import Graphics.Vty.Picture
8import Graphics.Vty.Image
10swIs1Column :: SingleColumnChar -> Bool
11swIs1Column (SingleColumnChar c) = imageWidth (char defAttr c) == 1
13dwIs2Column :: DoubleColumnChar -> Bool
14dwIs2Column (DoubleColumnChar c) = imageWidth (char defAttr c) == 2
16dcStringIsEven :: NonEmptyList DoubleColumnChar -> Bool
17dcStringIsEven (NonEmpty dw_list) =
18 even $ safeWcswidth [ c | DoubleColumnChar c <- dw_list ]
20safeWcwidthForControlChars :: Bool
21safeWcwidthForControlChars = 0 == safeWcwidth '\NUL'
25 [ verify "swIs1Column" swIs1Column
26 , verify "dwIs2Column" dwIs2Column
27 , verify "a string of double characters is an even width" dcStringIsEven
28 , verify "safeWcwidth provides a width of 0 for chars without widths" safeWcwidthForControlChars
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list