on master help sign in
Config: make allowCustomUnicodeWithTables more usable in Semigroup instance
8ecdb95Jonathan Daugherty
src/Graphics/Vty.hs+1−1
@@ -114,7 +114,7 @@ mkVty :: Config -> IO Vty
114mkVty appConfig = do
114mkVty appConfig = do
115 config <- (<> appConfig) <$> userConfig
115 config <- (<> appConfig) <$> userConfig
116
116
117− when (allowCustomUnicodeWithTables config) $
117+ when (allowCustomUnicodeWithTables config /= Just False) $
118 installWidthTable config
118 installWidthTable config
119
119
120 input <- inputForConfig config
120 input <- inputForConfig config
src/Graphics/Vty/Config.hs+5−3
@@ -149,8 +149,10 @@ data Config =
149 -- The default is the value of the TERM environment variable.
149 -- The default is the value of the TERM environment variable.
150 , termWidthMaps :: [(String, FilePath)]
150 , termWidthMaps :: [(String, FilePath)]
151 -- ^ Terminal width map files.
151 -- ^ Terminal width map files.
152− , allowCustomUnicodeWithTables :: Bool
152+ , allowCustomUnicodeWithTables :: Maybe Bool
153 -- ^ Whether to permit custom Unicode width table loading.
153 -- ^ 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.
154 }
156 }
155 deriving (Show, Eq)
157 deriving (Show, Eq)
156
158
@@ -171,7 +173,7 @@ instance Semigroup Config where
171 , termName = termName c1 <|> termName c0
173 , termName = termName c1 <|> termName c0
172 , termWidthMaps = termWidthMaps c1 <|> termWidthMaps c0
174 , termWidthMaps = termWidthMaps c1 <|> termWidthMaps c0
173 , allowCustomUnicodeWithTables =
175 , allowCustomUnicodeWithTables =
174− allowCustomUnicodeWithTables c0 || allowCustomUnicodeWithTables c1
176+ allowCustomUnicodeWithTables c1 <|> allowCustomUnicodeWithTables c0
175 }
177 }
176
178
177instance Monoid Config where
179instance Monoid Config where
@@ -186,7 +188,7 @@ instance Monoid Config where
186 , outputFd = Nothing
188 , outputFd = Nothing
187 , termName = Nothing
189 , termName = Nothing
188 , termWidthMaps = []
190 , termWidthMaps = []
189− , allowCustomUnicodeWithTables = True
191+ , allowCustomUnicodeWithTables = Nothing
190 }
192 }
191#if !(MIN_VERSION_base(4,11,0))
193#if !(MIN_VERSION_base(4,11,0))
192 mappend = (<>)
194 mappend = (<>)