@@ -15,7 +15,9 @@ import Data.Semigroup ((<>))
15import Graphics.Vty.UnicodeWidthTable.Types
15import Graphics.Vty.UnicodeWidthTable.Types
17-- | Returns True if and only if a custom table has been allocated and
17-- | Returns True if and only if a custom table has been allocated and
18−-- marked as ready for use. Returns False otherwise.
18+-- marked as ready for use.
20+-- This function is not thread-safe.
19isCustomTableReady :: IO Bool
21isCustomTableReady :: IO Bool
20isCustomTableReady = (== 1) <$> c_isCustomTableReady
22isCustomTableReady = (== 1) <$> c_isCustomTableReady
@@ -47,14 +49,15 @@ tableSize = 0x110000
47-- they don't want to control the terminal with 'mkVty' but do want to
49-- they don't want to control the terminal with 'mkVty' but do want to
48-- make calls to 'Graphics.Vty.Image.wcwidth'.
50-- make calls to 'Graphics.Vty.Image.wcwidth'.
50−-- It's also important to note that once a
52+-- It's also important to note that once a custom table has been
51−-- custom table has been installed, it is permanent for the life of the
53+-- installed, it is permanent for the life of the process. No new table
52−-- process. No new table can be installed, and the new custom table
54+-- can be installed, and the new custom table cannot be removed.
55-- If this function fails for any reason -- if the table cannot be
56-- If this function fails for any reason -- if the table cannot be
56-- installed or is invalid, or if a custom table already exists -- this
57-- installed or is invalid, or if a custom table already exists -- this
57-- will raise an exception by calling 'error'.
58-- will raise an exception by calling 'error'.
60+-- This function is not thread-safe.
58installUnicodeWidthTable :: UnicodeWidthTable -> IO ()
61installUnicodeWidthTable :: UnicodeWidthTable -> IO ()
59installUnicodeWidthTable table = do
62installUnicodeWidthTable table = do
60 initResult <- initCustomTable tableSize
63 initResult <- initCustomTable tableSize