mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
Config: make allowCustomUnicodeWithTables more usable in Semigroup instance
This commit is contained in:
parent
18ee5fe883
commit
8ecdb953e4
@ -114,7 +114,7 @@ mkVty :: Config -> IO Vty
|
||||
mkVty appConfig = do
|
||||
config <- (<> appConfig) <$> userConfig
|
||||
|
||||
when (allowCustomUnicodeWithTables config) $
|
||||
when (allowCustomUnicodeWithTables config /= Just False) $
|
||||
installWidthTable config
|
||||
|
||||
input <- inputForConfig config
|
||||
|
@ -149,8 +149,10 @@ data Config =
|
||||
-- The default is the value of the TERM environment variable.
|
||||
, termWidthMaps :: [(String, FilePath)]
|
||||
-- ^ Terminal width map files.
|
||||
, allowCustomUnicodeWithTables :: Bool
|
||||
, allowCustomUnicodeWithTables :: Maybe Bool
|
||||
-- ^ Whether to permit custom Unicode width table loading.
|
||||
-- 'Just False' indicates that table loading should not be
|
||||
-- performed. Other values permit table loading.
|
||||
}
|
||||
deriving (Show, Eq)
|
||||
|
||||
@ -171,7 +173,7 @@ instance Semigroup Config where
|
||||
, termName = termName c1 <|> termName c0
|
||||
, termWidthMaps = termWidthMaps c1 <|> termWidthMaps c0
|
||||
, allowCustomUnicodeWithTables =
|
||||
allowCustomUnicodeWithTables c0 || allowCustomUnicodeWithTables c1
|
||||
allowCustomUnicodeWithTables c1 <|> allowCustomUnicodeWithTables c0
|
||||
}
|
||||
|
||||
instance Monoid Config where
|
||||
@ -186,7 +188,7 @@ instance Monoid Config where
|
||||
, outputFd = Nothing
|
||||
, termName = Nothing
|
||||
, termWidthMaps = []
|
||||
, allowCustomUnicodeWithTables = True
|
||||
, allowCustomUnicodeWithTables = Nothing
|
||||
}
|
||||
#if !(MIN_VERSION_base(4,11,0))
|
||||
mappend = (<>)
|
||||
|
Loading…
Reference in New Issue
Block a user