Skip to content

Commit

Permalink
fix: use ErrorColor for hints marked as errors (#23430)
Browse files Browse the repository at this point in the history
# Description

When using `--hintAsError`, we want some red color to appear in the
logs.
Same is already done for `warningAsError`.

# Cherry-picking to Nim 1.6

Would be nice to cherry-pick this and the `warningAsError` log highlight
to 1.6 branch, as it's used in status-desktop.
  • Loading branch information
igor-sirotin committed Mar 21, 2024
1 parent 6c4c60e commit 50c1e93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/msgs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,10 @@ proc liMessage*(conf: ConfigRef; info: TLineInfo, msg: TMsgKind, arg: string,
ignoreMsg = not conf.hasHint(msg)
if not ignoreMsg and msg in conf.warningAsErrors:
title = ErrorTitle
color = ErrorColor
else:
title = HintTitle
color = HintColor
color = HintColor
inc(conf.hintCounter)

let s = if isRaw: arg else: getMessageStr(msg, arg)
Expand Down

0 comments on commit 50c1e93

Please sign in to comment.