"str" now returns EmptyImage for empty strings to match behavior of other string-like Image constructors (fixes #74)
commit9cfcb22e025a1f103ebf7d3b10d8fa522fde8ea7
authorJonathan Daugherty <cygnus@foobox.com>
dateSat 18 Jul 2015, 19:29 (11 years ago)
parentb130a2b
src/Graphics/Vty/Image.hs+2−1
@@ -117,7 +117,8 @@ char a c =
117117-- directly to iso10646String or string.
118118--
119119iso10646String :: Attr -> String -> Image
120−iso10646String a str =
120+iso10646String _ [] = EmptyImage
121+iso10646String a str =
121122 let displayWidth = safeWcswidth str
122123 in HorizText a (TL.pack str) displayWidth (length str)
123124