summary refs log tree commit diff stats
path: root/compiler/msgs.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-02-24 19:20:52 -0800
committerAndreas Rumpf <rumpf_a@web.de>2020-02-27 13:22:18 +0100
commitce36fdc8974b843b2fb0404196c2778e8b0b91dd (patch)
tree2d012b9ac70b16acf4b487a6440c906007cba331 /compiler/msgs.nim
parent96bffadf6045835ddefbf2903e135d50a93f7016 (diff)
downloadNim-ce36fdc8974b843b2fb0404196c2778e8b0b91dd.tar.gz
correctly honor cmdline --hint:conf:on/off ; correctly show Conf hints in order
Diffstat (limited to 'compiler/msgs.nim')
-rw-r--r--compiler/msgs.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index 6d1ecb2b1..7fa8e8aef 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -418,7 +418,10 @@ proc rawMessage*(conf: ConfigRef; msg: TMsgKind, args: openArray[string]) =
     inc(conf.warnCounter)
   of hintMin..hintMax:
     sev = Severity.Hint
-    if not conf.hasHint(msg): return
+    if msg in conf.cmdLineDisabledNotes: return # eg: `--hints:conf:off` passed on cmdline
+    # handle `--hints:off` (regardless of cmdline/cfg file)
+    # handle `--hints:conf:on` on cmdline
+    if not conf.hasHint(msg) and not (optHints in conf.options and msg in conf.cmdLineNotes)): return
     title = HintTitle
     color = HintColor
     if msg != hintUserRaw: kind = HintsToStr[ord(msg) - ord(hintMin)]