Skip to content

Commit 66afada

Browse files
Merge pull request #4203 from mpilgrem/fixStyles
Fix #4183 Make PrettyPrint styles background-agnostic
2 parents d790600 + ae62402 commit 66afada

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/Stack/PrettyPrint.hs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,57 +154,59 @@ debugBracket msg f = do
154154
output $ "Finished in" <+> displayMilliseconds diff <> ":" <+> msg
155155
return x
156156

157+
-- The following syles do not affect the colour of the background.
158+
157159
-- | Style an 'AnsiDoc' as an error. Should be used sparingly, not to style
158160
-- entire long messages. For example, it's used to style the "Error:"
159161
-- label for an error message, not the entire message.
160162
styleError :: AnsiDoc -> AnsiDoc
161-
styleError = dullred . ondullblack
163+
styleError = dullred
162164

163165
-- | Style an 'AnsiDoc' as a warning. Should be used sparingly, not to style
164166
-- entire long messages. For example, it's used to style the "Warning:"
165167
-- label for an error message, not the entire message.
166168
styleWarning :: AnsiDoc -> AnsiDoc
167-
styleWarning = yellow . ondullblack
169+
styleWarning = dullyellow
168170

169171
-- | Style an 'AnsiDoc' in a way to emphasize that it is a particularly good
170172
-- thing.
171173
styleGood :: AnsiDoc -> AnsiDoc
172-
styleGood = green . ondullblack
174+
styleGood = green
173175

174176
-- | Style an 'AnsiDoc' as a shell command, i.e. when suggesting something
175177
-- to the user that should be typed in directly as written.
176178
styleShell :: AnsiDoc -> AnsiDoc
177-
styleShell = magenta . ondullblack
179+
styleShell = magenta
178180

179181
-- | Style an 'AnsiDoc' as a filename. See 'styleDir' for directories.
180182
styleFile :: AnsiDoc -> AnsiDoc
181-
styleFile = bold . white . ondullblack
183+
styleFile = dullcyan
182184

183185
-- | Style an 'AsciDoc' as a URL. For now using the same style as files.
184186
styleUrl :: AnsiDoc -> AnsiDoc
185187
styleUrl = styleFile
186188

187189
-- | Style an 'AnsiDoc' as a directory name. See 'styleFile' for files.
188190
styleDir :: AnsiDoc -> AnsiDoc
189-
styleDir = bold . blue . ondullblack
191+
styleDir = bold . blue
190192

191193
-- | Style used to highlight part of a recommended course of action.
192194
styleRecommendation :: AnsiDoc -> AnsiDoc
193-
styleRecommendation = bold . green . ondullblack
195+
styleRecommendation = bold . green
194196

195197
-- | Style an 'AnsiDoc' in a way that emphasizes that it is related to
196198
-- a current thing. For example, could be used when talking about the
197199
-- current package we're processing when outputting the name of it.
198200
styleCurrent :: AnsiDoc -> AnsiDoc
199-
styleCurrent = yellow . ondullblack
201+
styleCurrent = dullyellow
200202

201203
-- TODO: figure out how to describe this
202204
styleTarget :: AnsiDoc -> AnsiDoc
203-
styleTarget = cyan . ondullblack
205+
styleTarget = cyan
204206

205207
-- | Style an 'AnsiDoc' as a module name
206208
styleModule :: AnsiDoc -> AnsiDoc
207-
styleModule = magenta . ondullblack -- TODO: what color should this be?
209+
styleModule = magenta -- TODO: what color should this be?
208210

209211
instance Display PackageName where
210212
display = fromString . packageNameString

0 commit comments

Comments
 (0)