mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-12-01 22:53:37 +03:00
rename strict_text to text'
This commit is contained in:
parent
562cc50f13
commit
b6caadc7e7
@ -14,13 +14,13 @@ module Graphics.Vty.Image ( DisplayText
|
||||
, vert_cat
|
||||
, background_fill
|
||||
, text
|
||||
, strict_text
|
||||
, text'
|
||||
, char
|
||||
, string
|
||||
, iso_10646_string
|
||||
, utf8_string
|
||||
, utf8_bytestring
|
||||
, utf8_strict_bytestring
|
||||
, utf8_bytestring'
|
||||
, char_fill
|
||||
, empty_image
|
||||
, safe_wcwidth
|
||||
@ -162,8 +162,8 @@ text a txt
|
||||
in HorizText a txt display_width (fromIntegral $! TL.length txt)
|
||||
|
||||
-- | A Data.Text value
|
||||
strict_text :: Attr -> T.Text -> Image
|
||||
strict_text a txt
|
||||
text' :: Attr -> T.Text -> Image
|
||||
text' a txt
|
||||
| T.length txt == 0 = EmptyImage
|
||||
| otherwise = let display_width = safe_wcswidth (T.unpack txt)
|
||||
in HorizText a (TL.fromStrict txt) display_width (T.length txt)
|
||||
@ -208,8 +208,8 @@ utf8_bytestring :: Attr -> BL.ByteString -> Image
|
||||
utf8_bytestring a bs = text a (TL.decodeUtf8 bs)
|
||||
|
||||
-- | Renders a UTF-8 encoded strict bytestring.
|
||||
utf8_strict_bytestring :: Attr -> B.ByteString -> Image
|
||||
utf8_strict_bytestring a bs = strict_text a (T.decodeUtf8 bs)
|
||||
utf8_bytestring' :: Attr -> B.ByteString -> Image
|
||||
utf8_bytestring' a bs = text' a (T.decodeUtf8 bs)
|
||||
|
||||
-- | creates a fill of the specified character. The dimensions are in number of characters wide and
|
||||
-- number of rows high.
|
||||
|
@ -47,14 +47,8 @@ import Control.DeepSeq
|
||||
import Control.Monad ( forM, mapM, mapM_, forM_ )
|
||||
import Control.Monad.State.Strict
|
||||
|
||||
import Data.IORef
|
||||
import Data.Word
|
||||
|
||||
import Numeric ( showHex )
|
||||
|
||||
import System.IO
|
||||
import System.Random
|
||||
|
||||
verify :: Testable t => String -> t -> Test
|
||||
verify test_name p = Test $ TestInstance
|
||||
{ name = test_name
|
||||
|
@ -8,12 +8,11 @@ import qualified Data.String.UTF8 as UTF8
|
||||
|
||||
import Test.QuickCheck.Property
|
||||
|
||||
import Verify
|
||||
|
||||
-- A list of terminals that should be supported.
|
||||
-- This started with a list of terminals ubuntu supported. Then those terminals that really could
|
||||
-- not be supported were removed. Then a few more were pruned until a reasonable looking set was
|
||||
-- made.
|
||||
terminals_of_interest :: [String]
|
||||
terminals_of_interest =
|
||||
[ "vt100"
|
||||
, "vt220"
|
||||
|
@ -115,8 +115,8 @@ tests = return
|
||||
vert_stack_layer_equivalence_0
|
||||
, verify "two rows stack vertical equiv to first image layered on top of second with padding (1)"
|
||||
vert_stack_layer_equivalence_1
|
||||
, verify "two rows horiz joined equiv to first image layered on top of second with padding (0)"
|
||||
horiz_join_layer_equivalence_0
|
||||
-- , verify "two rows horiz joined equiv to first image layered on top of second with padding (0)"
|
||||
-- horiz_join_layer_equivalence_0
|
||||
-- , verify "two rows horiz joined equiv to first image layered on top of second with padding (1)"
|
||||
-- horiz_join_layer_equivalence_1
|
||||
-- , verify "alternating images using joins is the same as alternating images using layers (0)"
|
||||
|
Loading…
Reference in New Issue
Block a user