mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
Config: add allowCustomUnicodeWithTables to control whether a custom table load is ever attempted
This commit is contained in:
parent
9edfd029cb
commit
9737f2b4ee
@ -113,7 +113,10 @@ data Vty = Vty
|
||||
mkVty :: Config -> IO Vty
|
||||
mkVty appConfig = do
|
||||
config <- (<> appConfig) <$> userConfig
|
||||
installWidthTable config
|
||||
|
||||
when (allowCustomUnicodeWithTables config) $
|
||||
installWidthTable config
|
||||
|
||||
input <- inputForConfig config
|
||||
out <- outputForConfig config
|
||||
intMkVty input out
|
||||
|
@ -148,6 +148,8 @@ data Config = Config
|
||||
, termName :: Maybe String
|
||||
-- | Terminal width map files.
|
||||
, termWidthMaps :: [(String, FilePath)]
|
||||
-- | Whether to permit custom Unicode width table loading.
|
||||
, allowCustomUnicodeWithTables :: Bool
|
||||
} deriving (Show, Eq)
|
||||
|
||||
defaultConfig :: Config
|
||||
@ -166,6 +168,7 @@ instance Semigroup Config where
|
||||
, outputFd = outputFd c1 <|> outputFd c0
|
||||
, termName = termName c1 <|> termName c0
|
||||
, termWidthMaps = termWidthMaps c1 <|> termWidthMaps c0
|
||||
, allowCustomUnicodeWithTables = allowCustomUnicodeWithTables c1
|
||||
}
|
||||
|
||||
instance Monoid Config where
|
||||
@ -180,6 +183,7 @@ instance Monoid Config where
|
||||
, outputFd = Nothing
|
||||
, termName = Nothing
|
||||
, termWidthMaps = []
|
||||
, allowCustomUnicodeWithTables = True
|
||||
}
|
||||
#if !(MIN_VERSION_base(4,11,0))
|
||||
mappend = (<>)
|
||||
|
Loading…
Reference in New Issue
Block a user