on master help sign in
Config: make allowCustomUnicodeWithTables more usable in Semigroup instance
commit8ecdb953e42e10e8bcb88f05589248fa36c70124 authorJonathan Daugherty <cygnus@foobox.com> dateTue 3 Mar 2020, 09:19 (7 years ago) parent18ee5fe
2 files changed+6−4
src/Graphics/Vty.hs+1−1 src/Graphics/Vty/Config.hs+5−3
src/Graphics/Vty.hs+1−1
@@ -114,7 +114,7 @@ mkVty :: Config -> IO Vty
114114mkVty appConfig = do
115115 config <- (<> appConfig) <$> userConfig
116116
117− when (allowCustomUnicodeWithTables config) $
117+ when (allowCustomUnicodeWithTables config /= Just False) $
118118 installWidthTable config
119119
120120 input <- inputForConfig config
src/Graphics/Vty/Config.hs+5−3
@@ -149,8 +149,10 @@ data Config =
149149 -- The default is the value of the TERM environment variable.
150150 , termWidthMaps :: [(String, FilePath)]
151151 -- ^ Terminal width map files.
152− , allowCustomUnicodeWithTables :: Bool
152+ , allowCustomUnicodeWithTables :: Maybe Bool
153153 -- ^ Whether to permit custom Unicode width table loading.
154+ -- 'Just False' indicates that table loading should not be
155+ -- performed. Other values permit table loading.
154156 }
155157 deriving (Show, Eq)
156158
@@ -171,7 +173,7 @@ instance Semigroup Config where
171173 , termName = termName c1 <|> termName c0
172174 , termWidthMaps = termWidthMaps c1 <|> termWidthMaps c0
173175 , allowCustomUnicodeWithTables =
174− allowCustomUnicodeWithTables c0 || allowCustomUnicodeWithTables c1
176+ allowCustomUnicodeWithTables c1 <|> allowCustomUnicodeWithTables c0
175177 }
176178
177179instance Monoid Config where
@@ -186,7 +188,7 @@ instance Monoid Config where
186188 , outputFd = Nothing
187189 , termName = Nothing
188190 , termWidthMaps = []
189− , allowCustomUnicodeWithTables = True
191+ , allowCustomUnicodeWithTables = Nothing
190192 }
191193#if !(MIN_VERSION_base(4,11,0))
192194 mappend = (<>)